Commit fe3f8f87 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:light:tsl2563 channel spec buglet / always reading same adc.

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: default avatarJon Brenner <jbrenner@taosinc.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 91ceae37
...@@ -465,7 +465,7 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev, ...@@ -465,7 +465,7 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev,
{ {
struct tsl2563_chip *chip = iio_priv(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); chip->calib0 = calib_from_sysfs(val);
else else
chip->calib1 = calib_from_sysfs(val); chip->calib1 = calib_from_sysfs(val);
...@@ -534,6 +534,7 @@ static const struct iio_chan_spec tsl2563_channels[] = { ...@@ -534,6 +534,7 @@ static const struct iio_chan_spec tsl2563_channels[] = {
{ {
.type = IIO_LIGHT, .type = IIO_LIGHT,
.indexed = 1, .indexed = 1,
.processed_val = 1,
.channel = 0, .channel = 0,
}, { }, {
.type = IIO_INTENSITY, .type = IIO_INTENSITY,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment