Skip to content

Commit

Permalink
iio: light: tcs3472: fix ATIME register write
Browse files Browse the repository at this point in the history
The integration time is controlled by the ATIME register only.  However,
this register is written by i2c_smbus_write_word_data() in write_raw().

We actually don't need to write a subsequent register.  So just use
i2c_smbus_write_byte_data() instead.

Cc: Peter Meerwald <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Acked-by: Peter Meerwald-Stadler <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
mita authored and jic23 committed Jul 1, 2017
1 parent e5c2ce6 commit 53d7d81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/light/tcs3472.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int tcs3472_write_raw(struct iio_dev *indio_dev,
for (i = 0; i < 256; i++) {
if (val2 == (256 - i) * 2400) {
data->atime = i;
return i2c_smbus_write_word_data(
return i2c_smbus_write_byte_data(
data->client, TCS3472_ATIME,
data->atime);
}
Expand Down

0 comments on commit 53d7d81

Please sign in to comment.