Skip to content

Commit

Permalink
iio:st_sensors: emulate SMBus block read if needed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gregor Boirie authored and Jonathan Cameron committed May 29, 2016
1 parent dfe3ab1 commit 169a88c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/common/st_sensors/st_sensors_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 169a88c

Please sign in to comment.