Re: [PATCH 1/2] iio: light: tcs3472: fix ATIME register write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 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 <pmeerw@xxxxxxxxxx>
> > Cc: Jonathan Cameron <jic23@xxxxxxxxxx>
> > Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> As I read the datasheet, this looks like it won't cause any actual
> harm (where the top byte is written is unused).

looks good to me as well,
Acked-by: Peter Meerwald-Stadler <pmeerw@xxxxxxxxxx>

> > ---
> >  drivers/iio/light/tcs3472.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c
> > index 3aa71e3..a9e153b 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);
> >  			}
> 

-- 

Peter Meerwald-Stadler
Mobile: +43 664 24 44 418
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux