mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
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: 596ef5cf65 ("iio: hid-sensor-prox: Add support for more channels")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20241122-fix-processed-v2-1-b9f606d3b519@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
954c06ddab
commit
0c45633c32
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user