From: "Nuno Sá" <nuno.sa@analog.com>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
jic23@kernel.org, andy@kernel.org, dlechner@baylibre.com
Subject: Re: [PATCH v1 1/1] iio: Allow device drivers to specify IIO event unit type
Date: Fri, 16 Oct 2026 09:37:54 +0100 [thread overview]
Message-ID: <atHhvhEahMT7TonZ@nsa> (raw)
In-Reply-To: <e359fa003ebc61c8b0e37ba9810a04c70e5a300e.1791437050.git.marcelo.schmitt@analog.com>
On Thu, Oct 08, 2026 at 02:27:15AM -0300, Marcelo Schmitt wrote:
> The IIO event ABI documentation distinguishes between interfaces that
> handle values in device-specific units (_raw) and event interfaces that
> handle values in real-world units (e.g. meters, Joules, lux, etc).
> However, the IIO event code infrastructure had never really implemented the
> bits to distinguish between those two types of interfaces.
>
> Because distinguishing between device (_raw) and real-world (_input) units
> only makes sense for value and hysteresis info, only add complementary enum
> item for those.
>
> Users of the IIO event ABI should, as much as possible, match the event
> unit type with the channel unit type. I.e. device drivers that present
> device-specific raw units for their channels ought to also provide event
> interfaces that handle raw units. Conversely, when IIO channels provide
> processed (_input) data, IIO events will generally be expected to operate
> over real-world units as well.
>
> Complement the IIO event info enum, allowing IIO drivers to specify what
> type of event info is used for their event interfaces.
>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> ---
> This was originally a patch series [1], but the suggestions provided back then
> allowed it to be greatly simplified.
>
> [1]: https://lore.kernel.org/linux-iio/cover.1768759292.git.marcelo.schmitt1@gmail.com/
>
> include/linux/iio/types.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> index d8944c9e5e90..bf03eb498753 100644
> --- a/include/linux/iio/types.h
> +++ b/include/linux/iio/types.h
> @@ -15,7 +15,11 @@
> enum iio_event_info {
> IIO_EV_INFO_ENABLE,
> IIO_EV_INFO_VALUE,
> + IIO_EV_INFO_VALUE_RAW,
> + IIO_EV_INFO_VALUE_INPUT,
> IIO_EV_INFO_HYSTERESIS,
> + IIO_EV_INFO_HYSTERESIS_RAW,
> + IIO_EV_INFO_HYSTERESIS_INPUT,
I might be missing something but how will the new values be different in
terms of ABI? Shouldn't we expose different interfaces depending on RAW
vs INPUT? Naturally we need to keep the old IIO_EV_INFO_VALUE ABI for
existing drivers and encourage new ones to use the new one. And if any
existing one wants to convert to the new thing, needs to keep both.
- Nuno Sá
> IIO_EV_INFO_PERIOD,
> IIO_EV_INFO_HIGH_PASS_FILTER_3DB,
> IIO_EV_INFO_LOW_PASS_FILTER_3DB,
>
> base-commit: 04434a1d0f311d76b1f15fa987918b471a0b8c6a
> --
> 2.53.0
>
prev parent reply other threads:[~2026-10-16 8:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 5:27 Marcelo Schmitt
2026-10-16 8:37 ` Nuno Sá [this message]
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=atHhvhEahMT7TonZ@nsa \
--to=nuno.sa@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.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®