From: Francesco Lavra <flavra@baylibre.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>,
David Lechner <dlechner@baylibre.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 6/7] iio: ABI: Add custom data type
Date: Thu, 26 Feb 2026 16:30:27 +0100 [thread overview]
Message-ID: <f637d8075569613f97fbe7ff6219e6adde53646d.camel@baylibre.com> (raw)
In-Reply-To: <aaAQtJ5WTDtkxi08@smile.fi.intel.com>
On Thu, 2026-02-26 at 11:21 +0200, Andy Shevchenko wrote:
> On Wed, Feb 25, 2026 at 03:27:55PM -0600, David Lechner wrote:
> > On 2/25/26 5:43 AM, Andy Shevchenko wrote:
> > > On Wed, Feb 25, 2026 at 11:18:06AM +0100, Francesco Lavra wrote:
> > > > 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.
> > >
> > > This rises the same Q as for other firmware-hidden algos, et cetera:
> > > How
> > > can we prevent the kernel from being just a simple proxy between HW
> > > and
> > > the userspace? What would be the point of having the "driver" in the
> > > kernel
> > > space?
> >
> > I tend to agree that this opens the door for misuse or an excuse to not
> > make the effort to develop something more generally useful on future
> > drivers.
> >
> > For this patch series, could we still use IIO_ROT and introduce a
> > new IIO_MOD_PARTIAL_QUATERNION that is defined according to the
> > description in the documentation patch in this series? This may be
> > the only driver that ever uses it, but it is still clearly defined.
> >
> > Or perhaps we could even say that if a IIO_MOD_QUATERNION has
> > .repeat = 3 instead of .repeat = 4, then it should be interpreted
> > this way?
>
> Not sure about the latter, but something explicit like
> IIO_MOD_PARTIAL_QUATERNION sounds good to me.
Another option could be having a custom iio_modifier instead of a custom
iio_chan_type. I think this would address the concern of drivers being just
a proxy between hardware and userspace. A custom modifier would be used
when the data representation for a given channel is too exotic to warrant a
generic iio_modifier enum value (but would still need to be documented so
that userspace can make use of it).
I can imagine a generic userspace application that interfaces with (in this
case) rotation sensors (i.e. looks for IIO_ROT channels) and can support
not only "standard" rotation data types (yaw, pitch, roll, quaternion, etc)
but also "manufacturer-specific" types.
We could even think about allowing more than one custom modifier (e.g.
everything >= IIO_MOD_CUSTOM is a custom modifier) so that a sensor can
have its "manufacturer-specific" data in multiple separate channels; and of
course each such custom modifier would have to be described in a per-driver
doc.
next prev parent reply other threads:[~2026-02-26 15:30 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 ` [PATCH v6 6/7] iio: ABI: Add custom data type Francesco Lavra
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 [this message]
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=f637d8075569613f97fbe7ff6219e6adde53646d.camel@baylibre.com \
--to=flavra@baylibre.com \
--cc=andriy.shevchenko@intel.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®