Re: [PATCH 2/2] iio: light: bh1730: Add bh1730 light sensor driver
From: Matti Vaittinen
Date: Mon May 11 2026 - 04:33:25 EST
On 10/05/2026 21:20, Andy Shevchenko wrote:
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.
Thanks for pinging me :) I am not super familiar with this particular sensor - original ROHM driver was written by my colleague Heikki, and not by me. I will anyways take a look and provide what-ever input I can. (I will also CC Heikki just in case, but he may not have the time to look this further. Besides, the email client which can be used with company email isn't really upstream compatible ;) ).
--
---
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~