From: Akinobu Mita Date: Mon, 12 Jun 2017 15:05:08 +0000 (+0900) Subject: iio: light: tcs3472: fix ATIME register write X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=53d7d8139f652f87e1d9aa877007e757d08fc59e;p=openwrt%2Fstaging%2Fblogic.git iio: light: tcs3472: fix ATIME register write 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 Cc: Jonathan Cameron Signed-off-by: Akinobu Mita Acked-by: Peter Meerwald-Stadler Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 3aa71e34ae28..a9e153b3e1f9 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -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); }