[PATCH] input: ad7879: use i2c_smbus_read_i2c_block_data() to lower overhead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Hennerich <michael.hennerich@xxxxxxxxxx>

Avoid additional addressing overhead incurred by word_data transfers.

Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
 drivers/input/touchscreen/ad7879-i2c.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c
index 3742ca1..50ed9e4 100644
--- a/drivers/input/touchscreen/ad7879-i2c.c
+++ b/drivers/input/touchscreen/ad7879-i2c.c
@@ -41,8 +41,12 @@ static int ad7879_i2c_read(void *client, u8 reg)
 static int ad7879_i2c_multi_read(void *client, u8 first_reg, u8 count, u16 *buf)
 {
 	u8 idx;
+
+	i2c_smbus_read_i2c_block_data(client, first_reg, count * 2, (u8 *)buf);
+
 	for (idx = 0; idx < count; ++idx)
-		buf[idx] = ad7879_i2c_read(client, first_reg + idx);
+		buf[idx] = swab16(buf[idx]);
+
 	return 0;
 }
 
-- 
1.7.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux