From: Jonathan Cameron <jic23@kernel.org>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: "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>,
"Esben Haabendal" <esben@geanix.com>,
"Kuppuswamy Sathyanarayanan"
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"Uwe Kleine-König (The Capable Hub)"
<u.kleine-koenig@baylibre.com>, "Pan Chuang" <panchuang@vivo.com>,
"Hemanth Selam" <hemanth.selam@gmail.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Nikita Travkin" <nikita@trvn.ru>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] iio: light: ltr501: Switch to read_avail() op from manual attribute registration
Date: Sat, 7 Nov 2026 03:20:42 +0000 [thread overview]
Message-ID: <20261107032042.0dd311fe@jic23-hlaptop> (raw)
In-Reply-To: <20261106091943.35783-2-clamor95@gmail.com>
On Fri, 6 Nov 2026 11:19:40 +0200
Svyatoslav Ryhel <clamor95@gmail.com> wrote:
> Switch to the read_avail() operation from manual attribute group
> registration. This eliminates the need for per-chip attribute_group
> structures and related ltr501_chip_info iio_info entries.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Given you were quick off the mark on sashiko on v1, I guess
you already saw:
https://sashiko.dev/#/patchset/20261106091943.35783-1-clamor95%40gmail.com
It seems correct that you'll only get one attribute where there were two
before. I suspect it's as simple as the mask should be set of
shared_by_type_available not shared_by_all for scale and shared_by_all
for only sampling frequency and integration time.
The current code is odd in having per type sampling_freq and integration
time as both apply to the light channel as well I think. Not vital
to fix that though so I'd just split the mask to make it work for both
as it does today.
The current way the two Intensity channels is done is very odd.
The .info_mask_shared_by_type should be the same for both of them
(only one set of attrs will be created).
Ideally fix that as a precursor patch (don't label it as a fix
though as it's just a code consistency thing rather than actually
resulting in a change.)
> ---
> drivers/iio/light/ltr501.c | 153 +++++++++++++------------------------
> 1 file changed, 52 insertions(+), 101 deletions(-)
>
> static const struct iio_info ltr501_info = {
> .read_raw = ltr501_read_raw,
> .write_raw = ltr501_write_raw,
> - .attrs = <r501_attribute_group,
> - .read_event_value = <r501_read_event,
> - .write_event_value = <r501_write_event,
> - .read_event_config = <r501_read_event_config,
> - .write_event_config = <r501_write_event_config,
> -};
> -
> -static const struct iio_info ltr301_info_no_irq = {
> - .read_raw = ltr501_read_raw,
> - .write_raw = ltr501_write_raw,
> - .attrs = <r301_attribute_group,
> -};
> -
> -static const struct iio_info ltr301_info = {
> - .read_raw = ltr501_read_raw,
> - .write_raw = ltr501_write_raw,
> - .attrs = <r301_attribute_group,
> - .read_event_value = <r501_read_event,
> - .write_event_value = <r501_write_event,
> - .read_event_config = <r501_read_event_config,
> - .write_event_config = <r501_write_event_config,
> + .read_avail = ltr501_read_avail,
> + .read_event_value = <r501_read_event,
> + .write_event_value = <r501_write_event,
> + .read_event_config = <r501_read_event_config,
> + .write_event_config = <r501_write_event_config,
I'd prefer a precursor patch tidying up the indent as that should make
the diff on this patch easier to read.
> };
next prev parent reply other threads:[~2026-11-07 3:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 9:19 [PATCH v2 0/4] iio: light: ltr501: Add LTR-659PS-01 prox sensor support Svyatoslav Ryhel
2026-11-06 9:19 ` [PATCH v2 1/4] iio: light: ltr501: Switch to read_avail() op from manual attribute registration Svyatoslav Ryhel
2026-11-07 3:20 ` Jonathan Cameron [this message]
2026-11-06 9:19 ` [PATCH v2 2/4] iio: light: ltr501: Switch to modern match mechanism Svyatoslav Ryhel
2026-11-07 3:30 ` Jonathan Cameron
2026-11-06 9:19 ` [PATCH v2 3/4] dt-bindings: iio: light: ltr501: Document LTR659 proximity sensor Svyatoslav Ryhel
2026-11-06 17:31 ` Conor Dooley
2026-11-06 9:19 ` [PATCH v2 4/4] iio: light: ltr501: Add support for the LTR-659PS-01 " Svyatoslav Ryhel
2026-11-07 3:33 ` Jonathan Cameron
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=20261107032042.0dd311fe@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=esben@geanix.com \
--cc=hemanth.selam@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nikita@trvn.ru \
--cc=nuno.sa@analog.com \
--cc=panchuang@vivo.com \
--cc=robh@kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=u.kleine-koenig@baylibre.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®