mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Arka Mondal <arka@arkamondal.net>
Cc: "Linus Walleij" <linusw@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Peter Meerwald" <pmeerw@pmeerw.net>,
	"Matt Ranostay" <mranostay@gmail.com>,
	"Robert Eshleman" <bobbyeshleman@gmail.com>,
	"Leonard Crestez" <cdleonard@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] iio: light: isl29125: Report the scale list via read_avail()
Date: Mon, 2 Nov 2026 22:26:34 +0000	[thread overview]
Message-ID: <20261102222634.6531dbe5@jic23-hlaptop> (raw)
In-Reply-To: <20261102074700.63075-2-arka@arkamondal.net>

On Mon,  2 Nov 2026 16:46:55 +0900
Arka Mondal <arka@arkamondal.net> wrote:

> The intensity channels set IIO_CHAN_INFO_SCALE in
> info_mask_shared_by_type, so userspace reads the scale from
> in_intensity_scale. The values that attribute accepts are listed by a
> custom attribute named scale_available. That name carries no channel
> prefix, so it is registered at the device level and is never paired
> with the channel. The core would have called it
> in_intensity_scale_available, which is also the name
> Documentation/ABI/testing/sysfs-bus-iio gives, so userspace does not
> find the list where the ABI says it is.
Hi Arka

Not quite true.  The core would have done as you said if it was set in the
iio_info_mask_shared_by_type.

Now if it were in iio_info_mask_shared_by_all it would be called
scale_available and hence match the existing ABI.

The device presents 4 channels and arguably this one only applies
to 3 of them as it doesn't apply to the timestamp.

For that reason we generally only use the share_by_all mask for
things like sampling_frequency.

However, whilst less than ideal the change you are proposing here
is a userspace ABI change and it's a bit arguable whether the current
ABI is buggy or not.  So in general I'd leave this one alone,
or as a simple cleanup rather than a fix, move it to the read_avail
callback and the mask that does generate the same ABI.

Other than that patch looks good.

Thanks,

Jonathan

> 
> Report the two values through read_avail() and drop the custom
> attribute group. The values and the text they print do not change.
> 
> Fixes: 208335138001 ("iio: light: isl29125: Add scale_available information")
> Signed-off-by: Arka Mondal <arka@arkamondal.net>
>  static int isl29125_buffer_postenable(struct iio_dev *indio_dev)


  reply	other threads:[~2026-11-02 22:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  7:46 [PATCH 0/6] iio: Give the *_available attributes the names the core generates Arka Mondal
2026-11-02  7:46 ` [PATCH 1/6] iio: light: isl29125: Report the scale list via read_avail() Arka Mondal
2026-11-02 22:26   ` Jonathan Cameron [this message]
2026-11-02  7:46 ` [PATCH 2/6] iio: light: apds9960: Report the available lists " Arka Mondal
2026-11-02  7:46 ` [PATCH 3/6] iio: light: max44009: Report the integration time " Arka Mondal
2026-11-02  7:46 ` [PATCH 4/6] iio: light: max44000: Report the available lists " Arka Mondal
2026-11-02  7:46 ` [PATCH 5/6] iio: humidity: hdc100x: " Arka Mondal
2026-11-02  7:47 ` [PATCH 6/6] iio: gyro: mpu3050: Fix the scale list and report it " Arka Mondal

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=20261102222634.6531dbe5@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=arka@arkamondal.net \
    --cc=bobbyeshleman@gmail.com \
    --cc=cdleonard@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=linusw@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mranostay@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=pmeerw@pmeerw.net \
    /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®