Re: [PATCH v6 5/7] iio: ABI: Add support for floating-point numbers in buffer scan elements

From: David Lechner

Date: Wed Feb 25 2026 - 16:27:30 EST


On 2/25/26 4:17 AM, Francesco Lavra wrote:
> In the data storage description of a scan element, the first character
> after the colon can have the values 's' and 'u' to specify signed and
> unsigned integers, respectively.
> Add 'f' as an allowed value to specify floating-point numbers formatted
> according to the IEEE 754 standard.
>
> Signed-off-by: Francesco Lavra <flavra@xxxxxxxxxxxx>
> ---
> Documentation/ABI/testing/sysfs-bus-iio | 33 +++++++++++++-----------
> Documentation/driver-api/iio/buffers.rst | 5 ++--
> Documentation/iio/iio_devbuf.rst | 3 ++-
> 3 files changed, 23 insertions(+), 18 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 5f87dcee78f7..61961bca4dce 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1510,21 +1510,24 @@ Contact: linux-iio@xxxxxxxxxxxxxxx
> Description:
> Description of the scan element data storage within the buffer
> and hence the form in which it is read from user-space.
> - Form is [be|le]:[s|u]bits/storagebits[>>shift].
> - be or le specifies big or little endian. s or u specifies if
> - signed (2's complement) or unsigned. bits is the number of bits
> - of data and storagebits is the space (after padding) that it
> - occupies in the buffer. shift if specified, is the shift that
> - needs to be applied prior to masking out unused bits. Some
> - devices put their data in the middle of the transferred elements
> - with additional information on both sides. Note that some
> - devices will have additional information in the unused bits
> - so to get a clean value, the bits value must be used to mask
> - the buffer output value appropriately. The storagebits value
> - also specifies the data alignment. So s48/64>>2 will be a
> - signed 48 bit integer stored in a 64 bit location aligned to
> - a 64 bit boundary. To obtain the clean value, shift right 2
> - and apply a mask to zero the top 16 bits of the result.
> + Form is [be|le]:[s|u|f]bits/storagebits[>>shift].

Not related to this patch, but I notice that this is missing "repeat".
\