mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] iio: proximity: sx93xx: reject fractional event values
@ 2026-12-04 16:31 Arnav Kapoor
  2026-12-04 16:31 ` [PATCH 1/3] iio: proximity: sx9310: " Arnav Kapoor
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Arnav Kapoor @ 2026-12-04 16:31 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá,
	Andy Shevchenko, Andy Shevchenko, Gwendal Grignou, Stephen Boyd,
	linux-iio, linux-kernel, Arnav Kapoor

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@gmail.com/
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-04 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 16:31 [PATCH 0/3] iio: proximity: sx93xx: reject fractional event values Arnav Kapoor
2026-12-04 16:31 ` [PATCH 1/3] iio: proximity: sx9310: " Arnav Kapoor
2026-12-04 17:31   ` Andy Shevchenko
2026-12-04 16:31 ` [PATCH 2/3] iio: proximity: sx9324: " Arnav Kapoor
2026-12-04 16:31 ` [PATCH 3/3] iio: proximity: sx9360: " Arnav Kapoor
2026-12-04 17:31 ` [PATCH 0/3] iio: proximity: sx93xx: " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®