Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 0/4] iio: light: opt4001: Fixes from code review
@ 2026-07-12 20:24 Nikhil Gautam
  2026-07-12 20:24 ` [PATCH v1 1/4] iio: light: opt4001: Fix read-modify-write of wrong register in power down Nikhil Gautam
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Nikhil Gautam @ 2026-07-12 20:24 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko,
	Stefan Windfeldt-Prytz, linux-iio, linux-kernel, Nikhil Gautam

Hi,

This series fixes a number of issues found while reviewing the opt4001
driver. All of them date back to the initial submission of the driver
in commit 9a9608418292 ("iio: light: Add support for TI OPT4001 light
sensor"). I have not added Fixes: tags; happy to resend with them if
preferred.

Patch 1 fixes a read-modify-write in opt4001_power_down() that reads
the device ID register instead of the control register, corrupting the
CTRL configuration on the way to power down.

Patch 2 fixes an incompatible pointer type passed as the remainder
argument to div_u64_rem(), which takes a u32 * rather than an int *.

Patch 3 makes opt4001_write_raw() reject integration time writes with
a non-zero integer (seconds) part, which were previously accepted
silently based on the microseconds part alone.

Patch 4 fixes reversed GENMASK() arguments in the (currently unused)
fault count mask definition and adds the _MASK suffix for consistency
with the neighbouring defines.

Datasheet: https://www.ti.com/lit/ds/symlink/opt4001.pdf

Thanks,
Nikhil Gautam

Nikhil Gautam (4):
  iio: light: opt4001: Fix read-modify-write of wrong register in power
    down
  iio: light: opt4001: Fix incompatible pointer type passed to
    div_u64_rem()
  iio: light: opt4001: Reject integration times with a non-zero seconds
    part
  iio: light: opt4001: Fix reversed GENMASK() arguments in fault count
    mask

 drivers/iio/light/opt4001.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

-- 
2.39.5


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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12 20:24 [PATCH 0/4] iio: light: opt4001: Fixes from code review Nikhil Gautam
2026-07-12 20:24 ` [PATCH v1 1/4] iio: light: opt4001: Fix read-modify-write of wrong register in power down Nikhil Gautam
2026-07-13  0:42   ` Jonathan Cameron
2026-07-13  3:33     ` Nikhil Gautam
2026-07-12 20:24 ` [PATCH v1 2/4] iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem() Nikhil Gautam
2026-07-13  0:43   ` Jonathan Cameron
2026-07-13  3:31     ` Nikhil Gautam
2026-07-12 20:24 ` [PATCH v1 3/4] iio: light: opt4001: Reject integration times with a non-zero seconds part Nikhil Gautam
2026-07-13  0:44   ` Jonathan Cameron
2026-07-12 20:24 ` [PATCH v1 4/4] iio: light: opt4001: Fix reversed GENMASK() arguments in fault count mask Nikhil Gautam
2026-07-13  0:45   ` Jonathan Cameron
2026-07-13 11:25   ` Andy Shevchenko

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