summaryrefslogtreecommitdiff
path: root/drivers/iio/common/st_sensors
diff options
context:
space:
mode:
authorGregor Boirie <gregor.boirie@parrot.com>2016-04-19 11:18:39 +0200
committerJonathan Cameron <jic23@kernel.org>2016-05-29 16:04:17 +0100
commit169a88c1ee19b0734c9703d51a6d8ebe538f5bc3 (patch)
tree05f6d4fe1b34fa122a266cbaae8f06e34f88a857 /drivers/iio/common/st_sensors
parentdfe3ab1af0765eb800da5ce4cb4c685783096d9c (diff)
downloadlwn-169a88c1ee19b0734c9703d51a6d8ebe538f5bc3.tar.gz
lwn-169a88c1ee19b0734c9703d51a6d8ebe538f5bc3.zip
iio:st_sensors: emulate SMBus block read if needed
Use SMBus "block read" protocol only when supported by adapter. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common/st_sensors')
-rw-r--r--drivers/iio/common/st_sensors/st_sensors_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
index 98cfee296d46..b43aa36031f8 100644
--- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
+++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
@@ -48,8 +48,8 @@ static int st_sensors_i2c_read_multiple_byte(
if (multiread_bit)
reg_addr |= ST_SENSORS_I2C_MULTIREAD;
- return i2c_smbus_read_i2c_block_data(to_i2c_client(dev),
- reg_addr, len, data);
+ return i2c_smbus_read_i2c_block_data_or_emulated(to_i2c_client(dev),
+ reg_addr, len, data);
}
static int st_sensors_i2c_write_byte(struct st_sensor_transfer_buffer *tb,