From 0c45633c3210730ca938772f3f450df6fff82b11 Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Date: Fri, 22 Nov 2024 17:36:52 +0000 Subject: [PATCH] iio: hid-sensor-prox: Fix invalid read_raw for attention The attention channel is a IIO_CHAN_INFO_PROCESSED, not a IIO_CHAN_INFO_RAW. Modify prox_read_raw() to support it. Fixes: 596ef5cf654b ("iio: hid-sensor-prox: Add support for more channels") Signed-off-by: Ricardo Ribalda Acked-by: Srinivas Pandruvada Link: https://patch.msgid.link/20241122-fix-processed-v2-1-b9f606d3b519@chromium.org Signed-off-by: Jonathan Cameron --- drivers/iio/light/hid-sensor-prox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index c83acbd782759..7ab64f5c623c1 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -94,6 +94,7 @@ static int prox_read_raw(struct iio_dev *indio_dev, *val2 = 0; switch (mask) { case IIO_CHAN_INFO_RAW: + case IIO_CHAN_INFO_PROCESSED: if (chan->scan_index >= prox_state->num_channels) return -EINVAL; address = prox_state->channel2usage[chan->scan_index]; -- 2.47.2