Commit 16ea10a7 authored by Michael Hennerich's avatar Michael Hennerich Committed by Dmitry Torokhov

Input: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead

Avoid additional addressing overhead incurred by word_data transfers.
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 14fbbc36
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment