[PATCH 0/2] iio: proximity: sx9310/sx9360: reject unsupported hardware gain values
From: Arnav Kapoor
Date: Sat Nov 07 2026 - 06:29:55 EST
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