From: Gregor Boirie Date: Tue, 19 Apr 2016 09:18:39 +0000 (+0200) Subject: iio:st_sensors: emulate SMBus block read if needed X-Git-Tag: v4.8-rc1~193^2~234^2~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=169a88c1ee19b0734c9703d51a6d8ebe538f5bc3;p=karo-tx-linux.git iio:st_sensors: emulate SMBus block read if needed Use SMBus "block read" protocol only when supported by adapter. Signed-off-by: Gregor Boirie Signed-off-by: Jonathan Cameron --- 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,