diff mbox

[4/4] Input: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead

Message ID 20100625082234.8617.98489.stgit@localhost.localdomain (mailing list archive)
State Accepted
Commit 16ea10a7d557a0177cbbd716b4a06e5373d513ba
Headers show

Commit Message

Dmitry Torokhov June 25, 2010, 8:22 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c
index f75f753..79e3857 100644
--- a/drivers/input/touchscreen/ad7879-i2c.c
+++ b/drivers/input/touchscreen/ad7879-i2c.c
@@ -51,10 +51,13 @@  static int ad7879_i2c_read(struct device *dev, u8 reg)
 static int ad7879_i2c_multi_read(struct device *dev,
 				 u8 first_reg, u8 count, u16 *buf)
 {
+	struct i2c_client *client = to_i2c_client(dev);
 	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(dev, first_reg + idx);
+		buf[idx] = swab16(buf[idx]);
 
 	return 0;
 }