Re: [PATCH 2/3] iio: light: opt4001: refactor driver to prepare to support more devices

From: Jesper X Nilsson

Date: Fri Oct 23 2026 - 06:26:31 EST


On 10/23/26 11:16, Joshua Crofts wrote:
On Fri, 23 Oct 2026 11:10:32 +0200
Joshua Crofts <joshua.crofts1@xxxxxxxxx> wrote:

On Fri, 23 Oct 2026 09:48:14 +0200
Jesper X Nilsson <jesper.x.nilsson@xxxxxxxx> wrote:

Prepare opt4001 driver to be able to support OPT4041. Extend struct
opt4001_chip_info with fields channels and device_id because OPT4041 has
two channels and another device id.

Datasheet: https://www.ti.com/lit/gpn/opt4041
Assisted-by: LLM

This tag has been deprecated.

Signed-off-by: Jesper X Nilsson <jesper.x.nilsson@xxxxxxxx>

...

@@ -388,19 +411,19 @@ static int opt4001_probe(struct i2c_client *client)
return dev_err_probe(&client->dev, ret,
"failed to reinit regmap cache\n");
+ chip->chip_info = i2c_get_match_data(client);

+ null check and return -ENODATA on failure.


Just noticed that Andy was faster :)

Yes, you were both fast :)
Thanks for the review!

Best regards,
Jesper