From: Francesco Lavra <flavra@baylibre.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v6 6/7] iio: ABI: Add custom data type
Date: Wed, 25 Feb 2026 11:06:05 +0100 [thread overview]
Message-ID: <20260225100608.2367061-6-flavra@baylibre.com> (raw)
In-Reply-To: <20260225100608.2367061-1-flavra@baylibre.com>
This type is used when the data received from or sent to a device cannot be
identified with a standard type and must be processed by custom userspace.
Any driver using the custom type must provide a driver-specific document
that explains what the data represents and how it is to be interpreted by
userspace.
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
---
Documentation/ABI/testing/sysfs-bus-iio | 19 +++++++++++++++++++
drivers/iio/industrialio-core.c | 1 +
include/uapi/linux/iio/types.h | 1 +
3 files changed, 21 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 61961bca4dce..2e45e54f54eb 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -450,6 +450,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_offset
What: /sys/bus/iio/devices/iio:deviceX/in_rot_offset
What: /sys/bus/iio/devices/iio:deviceX/in_angl_offset
What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset
+What: /sys/bus/iio/devices/iio:deviceX/in_custom_offset
+What: /sys/bus/iio/devices/iio:deviceX/in_customY_offset
KernelVersion: 2.6.35
Contact: linux-iio@vger.kernel.org
Description:
@@ -507,6 +509,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale
What: /sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale
What: /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale
What: /sys/bus/iio/devices/iio:deviceX/in_concentration_co2_scale
+What: /sys/bus/iio/devices/iio:deviceX/in_custom_scale
+What: /sys/bus/iio/devices/iio:deviceX/in_customY_scale
KernelVersion: 2.6.35
Contact: linux-iio@vger.kernel.org
Description:
@@ -1486,6 +1490,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_en
What: /sys/.../iio:deviceX/bufferY/in_pressure_en
What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_en
What: /sys/.../iio:deviceX/bufferY/in_proximity_en
+What: /sys/.../iio:deviceX/bufferY/in_custom_en
+What: /sys/.../iio:deviceX/bufferY/in_customZ_en
KernelVersion: 5.11
Contact: linux-iio@vger.kernel.org
Description:
@@ -1505,6 +1511,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_type
What: /sys/.../iio:deviceX/bufferY/in_pressure_type
What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_type
What: /sys/.../iio:deviceX/bufferY/in_proximity_type
+What: /sys/.../iio:deviceX/bufferY/in_custom_type
+What: /sys/.../iio:deviceX/bufferY/in_customZ_type
KernelVersion: 5.11
Contact: linux-iio@vger.kernel.org
Description:
@@ -1566,6 +1574,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_index
What: /sys/.../iio:deviceX/bufferY/in_pressure_index
What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_index
What: /sys/.../iio:deviceX/bufferY/in_proximity_index
+What: /sys/.../iio:deviceX/bufferY/in_custom_index
+What: /sys/.../iio:deviceX/bufferY/in_customZ_index
KernelVersion: 5.11
Contact: linux-iio@vger.kernel.org
Description:
@@ -2393,6 +2403,15 @@ Description:
The x and y light color coordinate on the CIE 1931 chromaticity
diagram.
+What: /sys/bus/iio/devices/iio:deviceX/in_custom_raw
+What: /sys/bus/iio/devices/iio:deviceX/in_customY_raw
+KernelVersion: 7.1
+Contact: linux-iio@vger.kernel.org
+Description:
+ Custom input value, whose type is driver-specific and is described
+ in a separate document. It can have a modifier Y, in which case it
+ is a measuremement from channel Y.
+
What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_either_label
What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_rising_label
What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_thresh_falling_label
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 22eefd048ba9..dd179e3b0fb7 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -98,6 +98,7 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_CHROMATICITY] = "chromaticity",
[IIO_ATTENTION] = "attention",
[IIO_ALTCURRENT] = "altcurrent",
+ [IIO_CUSTOM] = "custom"
};
static const char * const iio_modifier_names[] = {
diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
index 6d269b844271..47fefcdd693c 100644
--- a/include/uapi/linux/iio/types.h
+++ b/include/uapi/linux/iio/types.h
@@ -53,6 +53,7 @@ enum iio_chan_type {
IIO_CHROMATICITY,
IIO_ATTENTION,
IIO_ALTCURRENT,
+ IIO_CUSTOM
};
enum iio_modifier {
--
2.39.5
next prev parent reply other threads:[~2026-02-25 10:06 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 10:04 [PATCH v6 0/7] imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-02-25 10:06 ` [PATCH v6 1/7] iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only Francesco Lavra
2026-02-25 10:06 ` [PATCH v6 2/7] iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only Francesco Lavra
2026-02-25 10:06 ` [PATCH v6 3/7] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO Francesco Lavra
2026-02-25 10:06 ` [PATCH v6 4/7] iio: Rename 'sign' field to `format` in struct iio_scan_type Francesco Lavra
2026-02-25 10:06 ` [PATCH v6 5/7] iio: ABI: Add support for floating-point numbers in buffer scan elements Francesco Lavra
2026-02-25 10:06 ` Francesco Lavra [this message]
2026-02-25 10:06 ` [PATCH v6 7/7] iio: imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-02-25 10:11 ` [PATCH v6 1/7] iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only Francesco Lavra
2026-02-25 10:16 ` [PATCH v6 2/7] iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only Francesco Lavra
2026-02-28 17:56 ` Jonathan Cameron
2026-02-25 10:17 ` [PATCH v6 3/7] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO Francesco Lavra
2026-02-25 11:39 ` Andy Shevchenko
2026-02-26 9:43 ` Geert Uytterhoeven
2026-02-26 9:56 ` Andy Shevchenko
2026-02-28 16:38 ` Jonathan Cameron
2026-02-25 10:17 ` [PATCH v6 4/7] iio: Rename 'sign' field to `format` in struct iio_scan_type Francesco Lavra
2026-02-25 21:27 ` David Lechner
2026-02-28 17:59 ` Jonathan Cameron
2026-02-25 10:17 ` [PATCH v6 5/7] iio: ABI: Add support for floating-point numbers in buffer scan elements Francesco Lavra
2026-02-25 11:29 ` Andy Shevchenko
2026-02-25 21:27 ` David Lechner
2026-02-25 10:18 ` [PATCH v6 6/7] iio: ABI: Add custom data type Francesco Lavra
2026-02-25 11:43 ` Andy Shevchenko
2026-02-25 21:27 ` David Lechner
2026-02-26 9:21 ` Andy Shevchenko
2026-02-26 15:30 ` Francesco Lavra
2026-02-26 15:57 ` Andy Shevchenko
2026-02-28 17:52 ` Jonathan Cameron
2026-02-25 10:18 ` [PATCH v6 7/7] iio: imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-02-25 11:50 ` Andy Shevchenko
2026-02-25 21:41 ` David Lechner
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=20260225100608.2367061-6-flavra@baylibre.com \
--to=flavra@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
/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®