mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper X Nilsson <jesperni@axis.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>,
	Jesper X Nilsson <jesper.x.nilsson@axis.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Stefan Windfeldt-Prytz" <stefan.windfeldt-prytz@axis.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@axis.com
Subject: Re: [PATCH 3/3] iio: light: opt4001: add support for opt4041
Date: Fri, 23 Oct 2026 12:19:41 +0200	[thread overview]
Message-ID: <7cac8178-ee10-43b5-9fc1-6537b96e8c0a@axis.com> (raw)
In-Reply-To: <atslcgx03BMp-juY@ashevche-desk.local>

On 10/23/26 11:14, Andy Shevchenko wrote:
> On Fri, Oct 23, 2026 at 09:48:15AM +0200, Jesper X Nilsson wrote:
>> Extend the opt4001 driver to also support OPT4041. The devices are very
>> similar, with the difference being OPT4041 having two channels, one
>> visible and one wide band channel ranging from 380nm to 1000nm.
>>
>> The register map is almost the same. OPT4001 has registers to read out
>> the last four values sampled. OPT4041 maps to the same registers, but
>> has two channels, saving the last two samples for each channel.
> 
> ...
> 
>> Assisted-by: LLM
> 
> Drop this.
> 
I will drop the tag in v2.

> ...
> 
>>   	help
>>   	  If you say Y or M here, you get support for Texas Instruments
>> -	  OPT4001 Ambient Light Sensor.
>> +	  OPT4001 and OPT4041 Ambient Light Sensors.
> 
> We in IIO established kinda a style for this to be scalable, id est list them
> one-per-line:
> 
> 	  If you say Y or M here, you get support for Texas Instruments
> 	  Ambient Light Sensors:
> 	  - OPT4001 (...can add some short useful detail here...)
> 	  - OPT4041 (...can add some short useful detail here...)
> 
I will change to this style in v2.

>>   	  If built as a dynamically linked module, it will be called
>>   	  opt4001.
> 
> Perhaps also consider changing summary text at tristate to make it like
> "...OPT4001 and compatible".
> 
Good suggestion, will add it in v2.

> ...
> 
>> - * Device driver for the Texas Instruments OPT4001.
>> + * Device driver for the Texas Instruments OPT4001 and OPT4041.
> 
> Make this and MODULE_DESCRIPTION() to be the same as summary in the Kconfig,
> see above.
> 
I will update the MODULE_DESCRIPTION() in v2.

>>    */
> 
> ...
> 
>> +static const struct iio_chan_spec opt4041_channels[] = {
>> +	{
>> +		.type = IIO_LIGHT,
>> +		.address = OPT4001_LIGHT1_MSB,
>> +		.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
>> +		.info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_INT_TIME),
>> +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_INT_TIME)
> 
> Trailing comma.
> 
>> +	},
>> +	{
>> +		.type = IIO_INTENSITY,
>> +		.modified = 1,
>> +		.channel2 = IIO_MOD_LIGHT_BOTH,
>> +		.address = OPT4041_LIGHT2_MSB,
>> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
>> +		.info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_INT_TIME),
>> +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_INT_TIME)
> 
> Ditto.
> 
>> +	},
>> +};
> 
> ...
> 
>> +static const struct opt4001_chip_info opt4041_sot_5x3_info = {
>> +	.mul = 5850,
>> +	.div = 10000000,
> 
> Just sent a patch to move this to use struct s32_fract, I believe you may
> incorporate it into your series as a precursor).
> 
I will add the patch to my series.

>> +	.name = "opt4041-sot-5x3",
>> +	.channels = opt4041_channels,
>> +	.num_channels = ARRAY_SIZE(opt4041_channels),
>> +	.device_id = OPT4041_DEVICE_ID_VAL,
>> +};
> 
> ...
> 
>> +MODULE_DESCRIPTION("Texas Instruments opt4001 and opt4041 ambient light sensor driver");
> 
> See above.
> 

Thanks for the fast review!

Best regards,
Jesper


  reply	other threads:[~2026-10-23 10:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  7:48 [PATCH 0/3] This series adds support for Texas Instruments OPT4041 Ambient light sensor Jesper X Nilsson
2026-10-23  7:48 ` [PATCH 1/3] dt-bindings: iio: light: opt4001: add opt4041 Jesper X Nilsson
2026-10-23  7:48 ` [PATCH 2/3] iio: light: opt4001: refactor driver to prepare to support more devices Jesper X Nilsson
2026-10-23  9:07   ` Andy Shevchenko
2026-10-23 10:07     ` Jesper X Nilsson
2026-10-23 20:51       ` Jonathan Cameron
2026-10-23  9:10   ` Joshua Crofts
2026-10-23  9:16     ` Joshua Crofts
2026-10-23 10:22       ` Jesper X Nilsson
2026-10-23  7:48 ` [PATCH 3/3] iio: light: opt4001: add support for opt4041 Jesper X Nilsson
2026-10-23  9:14   ` Andy Shevchenko
2026-10-23 10:19     ` Jesper X Nilsson [this message]
2026-10-23  9:17 ` [PATCH 0/3] This series adds support for Texas Instruments OPT4041 Ambient light sensor Andy Shevchenko
2026-10-23 10:20   ` Jesper X Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cac8178-ee10-43b5-9fc1-6537b96e8c0a@axis.com \
    --to=jesperni@axis.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jesper.x.nilsson@axis.com \
    --cc=jic23@kernel.org \
    --cc=kernel@axis.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=stefan.windfeldt-prytz@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®