Re: [PATCH 2/2] iio: light: bh1730: Add bh1730 light sensor driver
From: Andy Shevchenko
Date: Sun May 10 2026 - 14:20:28 EST
On Sun, May 10, 2026 at 09:18:48PM +0300, Andy Shevchenko wrote:
> On Mon, May 11, 2026 at 01:09:50AM +0700, Alexandre Hamamdjian via B4 Relay wrote:
>
> > Add a driver for the ROHM BH1730FVC ambient light sensor. The device
> > is a 16-bit I2C digital sensor with separate visible and infrared
> > photodiodes, four selectable gains (1x/2x/64x/128x) and a programmable
> > integration time.
> >
> > The driver exposes illuminance via IIO, performs runtime gain and
> > integration-time tracking to keep the ADC in range, and supports
> > optional als-vdd / als-vid regulators. Per-board lux calibration data
> > (integration cycles, lux multiplier, optical-window coefficients, and
> > gain sensitivity coefficients) can be supplied via device tree;
> > sensible defaults are used otherwise.
>
> > +#include <linux/delay.h>
> > +#include <linux/i2c.h>
> > +#include <linux/iio/iio.h>
> > +#include <linux/module.h>
>
> > +#include <linux/of.h>
>
> Regular drivers do not to be OF-centric. This won't allow them to be used
> outside of OF-only platforms.
>
> > +#include <linux/time.h>
> > +#include <linux/regulator/consumer.h>
>
> Missing a lot of headers, follow IWYU.
...
> Here I stop my review and recommend you first to review others' patches and
> learn from other reviews. This will help you a lot with avoiding typical
> mistakes.
>
> Also Matti would be the best reviewer for this as he worked (still works?)
> for ROHM and knows the HW a bit more than average kernel developer.
Forgot to Cc Matti since I mentioned him. Now done.
--
With Best Regards,
Andy Shevchenko