iio: light: tsl2563: use correct event code
PATCH 1/1 iio: light: tsl2563: use correct event code
The TSL2563 driver provides three iio channels, two of which are raw ADC channels (channel 0 and channel 1) in the device and the remaining one is calculated by the two. The ADC channel 0 only supports programmable interrupt with threshold settings and this driver supports the event but the generated event code does not contain the corresponding iio channel type.
--- drivers/iio/light/tsl2563.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/tsl2563.c +1 -1
@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private)struct tsl2563_chip *chip =iio_priv (dev_info); iio_push_event(dev_info, - IIO_UNMOD_EVENT_CODE(IIO_LIGHT, + IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_EITHER),
Signature · 1 line
2.7.4
Quoted 9 lines · On Wed, 21 Jun 2017 01:46:37 +0900 Akinobu Mita <[email protected]> wrote:
The TSL2563 driver provides three iio channels, two of which are raw ADC channels (channel 0 and channel 1) in the device and the remaining one is calculated by the two. The ADC channel 0 only supports programmable interrupt with threshold settings and this driver supports the event but the generated event code does not contain the corresponding iio channel type.
Cc Jonathan Cameron <[email protected]>Signed-off-by Akinobu Mita <[email protected]>
Hmm. Patch is clearly correct, but this has been broken for a long time. I worry slightly that we may have userspace code depending on the broken format.
If any of that does turn up, we may have to emit both the write event code and the wrong one. Guess we'll wait and see what happens.
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
Jonathan
Quoted 17 lines
--- drivers/iio/light/tsl2563.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/tsl2563.c +1
-1@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private)struct tsl2563_chip *chip =iio_priv (dev_info); iio_push_event(dev_info, - IIO_UNMOD_EVENT_CODE(IIO_LIGHT, + IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_EITHER),