aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ad7879-i2c.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2010-06-30 17:51:09 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-03 16:13:19 -0400
commit16ea10a7d557a0177cbbd716b4a06e5373d513ba (patch)
tree6d2dd43c1a5ce6bbf4b056e0e8c39d96fc7acf0d /drivers/input/touchscreen/ad7879-i2c.c
parent14fbbc36d126d7ec7717144def386b9fc4c7fba2 (diff)
Input: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead
Avoid additional addressing overhead incurred by word_data transfers. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/ad7879-i2c.c')
-rw-r--r--drivers/input/touchscreen/ad7879-i2c.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c
index 81937b21e9d2..d82a38ee9a3e 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)
51static int ad7879_i2c_multi_read(struct device *dev, 51static int ad7879_i2c_multi_read(struct device *dev,
52 u8 first_reg, u8 count, u16 *buf) 52 u8 first_reg, u8 count, u16 *buf)
53{ 53{
54 struct i2c_client *client = to_i2c_client(dev);
54 u8 idx; 55 u8 idx;
55 56
57 i2c_smbus_read_i2c_block_data(client, first_reg, count * 2, (u8 *)buf);
58
56 for (idx = 0; idx < count; ++idx) 59 for (idx = 0; idx < count; ++idx)
57 buf[idx] = ad7879_i2c_read(dev, first_reg + idx); 60 buf[idx] = swab16(buf[idx]);
58 61
59 return 0; 62 return 0;
60} 63}