[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <853def565622848427e6e5df8f073465fa52e76c.camel@linux.intel.com>
Date: Thu, 21 Nov 2024 08:44:53 -0800
From: srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>
To: Ricardo Ribalda <ribalda@...omium.org>, Jiri Kosina <jikos@...nel.org>,
Jonathan Cameron
<jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
linux-input@...r.kernel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: hid-sensor-prox: Fix invalid read_raw for attention
On Thu, 2024-11-21 at 09:16 +0000, Ricardo Ribalda wrote:
> The attention channel is a IIO_CHAN_INFO_PROCESSED, not a
> IIO_CHAN_INFO_RAW.
>
> Modify prox_read_raw() to support it.
>
What is the sysfs entry to trigger this IIO_CHAN_INFO_PROCESSED read?
Don't you have an entry *_raw?
Thanks,
Srinivas
> Fixes: 596ef5cf654b ("iio: hid-sensor-prox: Add support for more
> channels")
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> ---
> drivers/iio/light/hid-sensor-prox.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/light/hid-sensor-prox.c
> b/drivers/iio/light/hid-sensor-prox.c
> index e8e7b2999b4c..8e5d0ad13a5f 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];
> @@ -107,8 +108,7 @@ static int prox_read_raw(struct iio_dev
> *indio_dev,
>
> report_id,
>
> SENSOR_HUB_SYNC,
> min < 0);
> - if (prox_state->channel2usage[chan->scan_index] ==
> - HID_USAGE_SENSOR_HUMAN_ATTENTION)
> + if (mask == IIO_CHAN_INFO_PROCESSED)
> *val *= 100;
> hid_sensor_power_state(&prox_state-
> >common_attributes, false);
> ret_type = IIO_VAL_INT;
>
> ---
> base-commit: decc701f41d07481893fdea942c0ac6b226e84cd
> change-id: 20241121-fix-processed-ed1a95641e64
>
> Best regards,
Powered by blists - more mailing lists