Re: [PATCH v2 0/4] iio: light: tsl2591: fix lux calculation and precision, add I2C ID table, report saturation
From: Andy Shevchenko
Date: Thu Oct 15 2026 - 14:39:48 EST
On Wed, Oct 14, 2026 at 04:16:46PM +0200, Jan Remes wrote:
> This series fixes several issues found while using the TSL2591 in
> company products (Raspberry Pi CM5) and when testing (x86_64 laptops
> with MCP2221 USB-I2C bridge).
>
> The original field report found that the illumination value has always
> been 0.0 (caused by division by zero on ARM).
>
> Patch 1 fixes divisions by zero in the lux calculation, which occur with
> LOW gain and short integration times, or in darkness when CH0 = 0.
>
> Patch 2 adds an i2c_device_id table so the driver can be probed on systems
> without CONFIG_OF.
>
> Patch 3 makes the driver return an error instead of a bogus value when the
> sensor is saturated.
>
> Patch 4 improves the formula for calculating lux values to make the
> returned value more accurate.
>
> Patches 3 and 4 change existing behavior, I am OK with splitting the
> series into two, if that makes things better.
>
> AI assistance: Claude Code (Claude Opus 5.5) was used for research on
> sensor behavior, datasheets and Adafruit library, to compare results
> produced by old and new formula, to draft some code for patches 1 and 4.
> I reviewed all of it and tested it on x86_64.
>From my view (haven't checked the calculations, though) this looks good,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko