From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org,
dlechner@baylibre.com, marcelo.schmitt1@gmail.com
Subject: [PATCH v1 1/1] iio: Allow device drivers to specify IIO event unit type
Date: Thu, 8 Oct 2026 02:27:15 -0300 [thread overview]
Message-ID: <e359fa003ebc61c8b0e37ba9810a04c70e5a300e.1791437050.git.marcelo.schmitt@analog.com> (raw)
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,
IIO_EV_INFO_PERIOD,
IIO_EV_INFO_HIGH_PASS_FILTER_3DB,
IIO_EV_INFO_LOW_PASS_FILTER_3DB,
base-commit: 04434a1d0f311d76b1f15fa987918b471a0b8c6a
--
2.53.0
next reply other threads:[~2026-10-08 5:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 5:27 Marcelo Schmitt [this message]
2026-10-16 8:37 ` Nuno Sá
2026-10-18 18:18 ` 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=e359fa003ebc61c8b0e37ba9810a04c70e5a300e.1791437050.git.marcelo.schmitt@analog.com \
--to=marcelo.schmitt1@gmail.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=nuno.sa@analog.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®