diff options
author | Jonathan Cameron <jic23@kernel.org> | 2012-04-13 10:24:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-13 10:59:38 -0700 |
commit | fe3f8f87edf99d9d5122f890208538e0afabd8ce (patch) | |
tree | 1f86eb5b458fcccb2960bef8d5d0dc69e352d67b /drivers/staging/iio/light/tsl2563.c | |
parent | 91ceae374e1ece88c8f575259ee0ad7da28ae8ab (diff) |
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: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/light/tsl2563.c')
-rw-r--r-- | drivers/staging/iio/light/tsl2563.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 546c95a4ea9e..beb51d7122cd 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c @@ -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); @@ -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, |