Skip to content

Commit

Permalink
staging:iio:light:tsl2563 channel spec buglet / always reading same adc.
Browse files Browse the repository at this point in the history
The IIO_LIGHT channel was not marked as being a processed_val despite
clearly being in lux.

The IIO_INTENSITY channel reads were dependent on channel and that isn't
specified for either adc (as they now use modifiers).  Hence use the
modifier instead.

Reported-by: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 13, 2012
1 parent 91ceae3 commit fe3f8f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/iio/light/tsl2563.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev,
{
struct tsl2563_chip *chip = iio_priv(indio_dev);

if (chan->channel == 0)
if (chan->channel == IIO_MOD_LIGHT_BOTH)
chip->calib0 = calib_from_sysfs(val);
else
chip->calib1 = calib_from_sysfs(val);
Expand Down Expand Up @@ -534,6 +534,7 @@ static const struct iio_chan_spec tsl2563_channels[] = {
{
.type = IIO_LIGHT,
.indexed = 1,
.processed_val = 1,
.channel = 0,
}, {
.type = IIO_INTENSITY,
Expand Down

0 comments on commit fe3f8f8

Please sign in to comment.