Re: [PATCH v6 2/2] iio: light: add AS7343 multi-spectral sensor driver
From: Andy Shevchenko
Date: Wed Oct 14 2026 - 06:39:13 EST
On Wed, Oct 14, 2026 at 11:17:55AM +0800, Chang Yu wrote:
> On Tue, Oct 13, 2026 at 07:27:42PM +0300, Andy Shevchenko wrote:
> > On Tue, Oct 13, 2026 at 07:56:39PM +0800, Chang Yu wrote:
...
> > > +/*
> > > + * Integration time is calculated as (ATIME + 1) * ((ASTEP + 1) * 2.78us).
> > > + * ATIME must be between 0 and 255, inclusive
> > > + * ASTEP must be between 0 and 65534, inclusive
> >
> > Haven't noticed before, but is it indeed 65534 and not 65535 here (or 255 and
> > not 254 above)? Haven't checked datasheet, please double check.
> >
> Per the datasheet 0 <= ASTEP <= 65534 (65535 was explicitly marked as "do not
> use"), and since ASTEP = n - 1, we have 1 <= n <= 65535. Similary
> 0 <= ATIME <= 255, ATIME = step - 1, so 1 <= step <= 256.
>
> So I think the numbers here are correct.
Thanks for checking! In case you need a new version, just add that into the
above comment, like
* Per datasheet, do not use 65535 for ASTEP.
--
With Best Regards,
Andy Shevchenko