Re: [PATCH v8 1/2] Added AMS tsl2591 driver implementation
From: Joe Sandom
Date: Sun Apr 18 2021 - 18:17:35 EST
On Sat, Apr 17, 2021 at 03:50:16PM +0300, Andy Shevchenko wrote:
> On Fri, Apr 16, 2021 at 8:49 PM Joe Sandom <joe.g.sandom@xxxxxxxxx> wrote:
> >
> > Driver implementation for AMS/TAOS tsl2591 ambient light sensor.
> >
> > This driver supports configuration via device tree and sysfs.
> > Supported channels for raw infrared light intensity,
> > raw combined light intensity and illuminance in lux.
> > The driver additionally supports iio events on lower and
> > upper thresholds.
> >
> > This is a very-high sensitivity light-to-digital converter that
> > transforms light intensity into a digital signal.
>
> Hmm... It's v8 and the subject line is wrongly formatted.
> Please add the corresponding prefix "iio: light: ..."
>
Thanks for pointing that out Andy. I'll be sure to correct this in v9.
> Otherwise it's in very good shape.
>
> ...
>
> > +/* TSL2591 enable register definitions */
> > +#define TSL2591_PWR_ON 0x01
> > +#define TSL2591_PWR_OFF 0x00
>
> > +#define TSL2591_ENABLE_ALS 0x02
> > +#define TSL2591_ENABLE_ALS_INT 0x10
> > +#define TSL2591_ENABLE_SLEEP_INT 0x40
> > +#define TSL2591_ENABLE_NP_INT 0x80
>
> Is it a bitfield?
>
> ...
>
> > + als_lower_l = als_lower_threshold;
>
> >> 0, but it's up to you.
>
> > + als_lower_h = als_lower_threshold >> 8;
>
> ...
>
> > + als_upper_l = als_upper_threshold;
> > + als_upper_h = als_upper_threshold >> 8;
>
> Ditto.
>
> --
> With Best Regards,
> Andy Shevchenko