mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: proximity: sx9310/sx9360: reject unsupported hardware gain values
@ 2026-11-07 11:17 Arnav Kapoor
  2026-11-07 11:17 ` [PATCH 1/2] iio: proximity: sx9310: " Arnav Kapoor
  2026-11-07 11:17 ` [PATCH 2/2] iio: proximity: sx9360: " Arnav Kapoor
  0 siblings, 2 replies; 5+ messages in thread
From: Arnav Kapoor @ 2026-11-07 11:17 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_write_gain() and sx9360_write_gain() accept any integer and
squeeze ilog2() of it into the register field. Values other than the
advertised 1, 2, 4 and 8 are silently rounded, wrapped or (for 0 and
negative values) turned into the maximum code, and the write reports
success. sx9324 already rejects such values; this does the same for the
other two. One patch per driver, as the Fixes tags differ.

Compile-tested only (W=1); I don't have SX9310 or SX9360 hardware.

Arnav Kapoor (2):
  iio: proximity: sx9310: reject unsupported hardware gain values
  iio: proximity: sx9360: reject unsupported hardware gain values

 drivers/iio/proximity/sx9310.c | 3 +++
 drivers/iio/proximity/sx9360.c | 3 +++
 2 files changed, 6 insertions(+)


base-commit: 340d44bdf9db0f095f99845b5ad8628781d79b6f
-- 
2.53.0


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

end of thread, other threads:[~2026-11-07 19:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07 11:17 [PATCH 0/2] iio: proximity: sx9310/sx9360: reject unsupported hardware gain values Arnav Kapoor
2026-11-07 11:17 ` [PATCH 1/2] iio: proximity: sx9310: " Arnav Kapoor
2026-11-07 19:06   ` Jonathan Cameron
2026-11-07 11:17 ` [PATCH 2/2] iio: proximity: sx9360: " Arnav Kapoor
2026-11-07 19:07   ` Jonathan Cameron

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®