Re: [PATCH v2 2/2] iio: light: max44009: Report the integration time via read_avail()

From: Jonathan Cameron

Date: Sat Nov 14 2026 - 18:41:31 EST


On Tue, 10 Nov 2026 01:19:57 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Mon, Nov 09, 2026 at 02:07:38PM +0900, Arka Mondal wrote:
> > The integration times the light channel accepts are listed by a custom
> > attribute named illuminance_integration_time_available. That name has
> > no in_ prefix, so it is registered at the device level instead of
> > beside in_illuminance_integration_time, and userspace looking for
> > in_illuminance_integration_time_available finds nothing.
> >
> > Report the list through read_avail() and drop the custom attribute.
>
> Will break it user space?

Yes, but given no standard tools would have looked for that naming
we should be able to get away with it without anyone noticing.

Given it's an optional attribute I'm guessing everything just assumed
it wasn't provided.

Always the risk of a custom board script of course that might cause
us to have to carry the old broken ABI.

Arka, you should clearly state thee concerns in the patch description
to answer questions like the one Andy raised.

Thanks

Jonathan

>
> > All eight values are a whole number of microseconds, so they go in as
> > IIO_VAL_INT_PLUS_MICRO pairs with nothing rounded. The values do not
> > change; the core prints them with six decimals, so the attribute reads
> > 0.800000 down to 0.006250 instead of 0.8 down to 0.00625. read_raw()
> > still reports the time itself as IIO_VAL_INT_PLUS_NANO.
>
> ...
>
> > +static const int max44009_int_time_avail[] = {
> > + 0, 800000,
> > + 0, 400000,
> > + 0, 200000,
> > + 0, 100000,
> > + 0, 50000,
> > + 0, 25000,
> > + 0, 12500,
> > + 0, 6250,
> > +};
>
> Make it 2d array.
>