Re: [PATCH v2] iio: light: al3010: fix incorrect scale for the highest gain range
Jonathan Cameron <[email protected]> Sun, 5 Jul 2026 00:06:16 +0100
| Newsgroups | dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260705000616.3aaa1254@jic23-huawei> |
On Sat, 4 Jul 2026 15:13:42 +0300 Andy Shevchenko <[email protected]> wrote: > On Sat, Jul 04, 2026 at 05:22:45PM +0530, Vidhu Sarwal wrote: > > al3010_scales[] encodes the highest gain range as {0, 1187200}. > > For IIO_VAL_INT_PLUS_MICRO, the fractional part must be less than > > 1000000, so the scale 1.1872 should instead be represented as > > { 1, 187200 }. > > > > Since write_raw() compares the value from userspace against this > > table, writing the advertised 1.1872 scale never matches the malformed > > entry and returns -EINVAL. As a result, the highest gain range cannot > > be selected. Reading the scale in that state also reports the malformed > > value. > > Reviewed-by: Andy Shevchenko <[email protected]> > For future reference, please never send a new version in reply to an earlier version. It both gets very confusing as threads develop and also puts your patches way back in the maintainers inbox, which often slows down getting them applied. Applied and marked for stable thanks, Jonathan