Message ID | 20250317013634.4117399-1-lixu.zhang@intel.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | iio: hid-sensor-prox: Add support for 16-bit report size | expand |
On Mon, 17 Mar 2025 09:36:34 +0800 Zhang Lixu <lixu.zhang@intel.com> wrote: > On Intel platforms, the HID_USAGE_SENSOR_HUMAN_PROXIMITY report size is 16 > bits. This patch adds support for handling 16-bit report sizes for the > HID_USAGE_SENSOR_HUMAN_PROXIMITY usage in the HID sensor proximity driver. > > Previously, the driver only supported 8-bit and 32-bit report sizes. With > this change, the driver can now correctly process 16-bit proximity data, > ensuring accurate human presence detection on platforms where this report > size is used. > > Signed-off-by: Zhang Lixu <lixu.zhang@intel.com> > Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Applied. Thanks. If it is reasonably urgent we could slip this in after rc1 as it smells a bit fix like. For now I've queued it for next cycle. Jonathan > --- > drivers/iio/light/hid-sensor-prox.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c > index 76b76d12b388..3a7b48803d50 100644 > --- a/drivers/iio/light/hid-sensor-prox.c > +++ b/drivers/iio/light/hid-sensor-prox.c > @@ -213,6 +213,9 @@ static int prox_capture_sample(struct hid_sensor_hub_device *hsdev, > case 1: > prox_state->human_presence[chan] = *(u8 *)raw_data * multiplier; > return 0; > + case 2: > + prox_state->human_presence[chan] = *(u16 *)raw_data * multiplier; > + return 0; > case 4: > prox_state->human_presence[chan] = *(u32 *)raw_data * multiplier; > return 0; > > base-commit: eea255893718268e1ab852fb52f70c613d109b99
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index 76b76d12b388..3a7b48803d50 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -213,6 +213,9 @@ static int prox_capture_sample(struct hid_sensor_hub_device *hsdev, case 1: prox_state->human_presence[chan] = *(u8 *)raw_data * multiplier; return 0; + case 2: + prox_state->human_presence[chan] = *(u16 *)raw_data * multiplier; + return 0; case 4: prox_state->human_presence[chan] = *(u32 *)raw_data * multiplier; return 0;