Re: [PATCH v3 2/2] iio: light: add AS7343 multi-spectral sensor driver
From: Andy Shevchenko
Date: Fri Sep 11 2026 - 01:49:53 EST
On Thu, Sep 10, 2026 at 12:22:01PM -0700, Chang Yu wrote:
> On Thu, Sep 10, 2026 at 12:07:42PM +0300, Andy Shevchenko wrote:
> > On Wed, Sep 09, 2026 at 11:38:13PM -0700, Chang Yu wrote:
...
> > > + name = as7343_channel_label(chan);
> > > + if (!name)
> > > + return -EINVAL;
> >
> > Why? Can't it be taken from DT?
>
> These channel labels correspond to the physical optical channel
> names defined by the datasheet. Each name corresponds to a
> pre-defined range of wavelengths. They are fixed internal properties
> of the chip, so IMO hardcoding them in the driver is more
> approriate.
Please, make a comment on top of the string array, with probably citing the
datasheet table with the wavelength ranges.
/*
* Channel names as defined in the datasheet:
* // hypothetical example // ... - 200-300 nm
* ...
*/
static const char * const ..._names[] = {
...names...
};
--
With Best Regards,
Andy Shevchenko