[PATCH 0/3] iio: proximity: sx93xx: reject fractional event values
From: Arnav Kapoor
Date: Fri Dec 04 2026 - 11:32:15 EST
sx9310, sx9324 and sx9360 ignore val2 in write_event_val(). All their
event values (threshold, period, hysteresis) are integers and read back
as IIO_VAL_INT, but writes are parsed as IIO_VAL_INT_PLUS_MICRO, so 1.5
is stored as 1 and -0.999999 is accepted as 0. Each patch returns
-EINVAL for a non-zero val2, once at the top of the callback, so it
covers every event value and not only the hysteresis.
This is the follow-up Jonathan suggested on v3 of the gain/threshold
series:
https://lore.kernel.org/all/20261128115534.558478-1-kapoorarnav43@xxxxxxxxx/
It applies on its own on the current iio testing and also merges
cleanly with v4 of that series.
Compile-tested only (W=1 for every patch, checkpatch --strict clean); I
don't have SX93xx hardware.
Arnav Kapoor (3):
iio: proximity: sx9310: reject fractional event values
iio: proximity: sx9324: reject fractional event values
iio: proximity: sx9360: reject fractional event values
drivers/iio/proximity/sx9310.c | 4 ++++
drivers/iio/proximity/sx9324.c | 4 ++++
drivers/iio/proximity/sx9360.c | 4 ++++
3 files changed, 12 insertions(+)
base-commit: fba506008a5b548ad2708bc2765a039cb00a47ab
--
2.53.0