Re: [PATCH v3 1/3] iio: types: add IIO_VOLUMEFLOW channel type
From: Marcelo Schmitt
Date: Sun May 31 2026 - 14:09:41 EST
On 05/30, Wadim Mueller wrote:
> Add a new IIO channel type for liquid volumetric flow sensors. The
> unit exposed via the standard _scale attribute is litres per second
> (l/s), so drivers reporting smaller native units (e.g. ml/min) only
> need to set a fractional scale.
>
> Update iio-core's name table, the iio_event_monitor whitelist and
> the sysfs-bus-iio ABI document to match. The new _scale attribute is
> folded into the existing shared _scale block; only the per-type _raw
> needs a fresh entry.
>
> Signed-off-by: Wadim Mueller <wafgo01@xxxxxxxxx>
> ---
> Documentation/ABI/testing/sysfs-bus-iio | 11 +++++++++++
> drivers/iio/industrialio-core.c | 1 +
> include/uapi/linux/iio/types.h | 1 +
> tools/iio/iio_event_monitor.c | 2 ++
> 4 files changed, 15 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 5f87dcee7..2188557cb 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -507,6 +507,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_volumeflow_scale
> +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflowY_scale
> KernelVersion: 2.6.35
> Contact: linux-iio@xxxxxxxxxxxxxxx
> Description:
> @@ -2458,3 +2460,12 @@ Description:
> seconds, expressed as:
>
> - a range specified as "[min step max]"
> +
> +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflow_raw
> +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflowY_raw
> +KernelVersion: 6.19
This is probably only landing in kernel 7.2 (or later?), so bumping the version
seems appropriate.
> +Contact: linux-iio@xxxxxxxxxxxxxxx
> +Description:
> + Raw (unscaled) volumetric flow rate reading from the channel.
> + To convert to standard units (litres per second) apply the
> + channel's _scale (and _offset, when present).
Early reviews suggested to use SI units so I think we would have cubic meters
per second. Disregard if I missed some review accepting it as liters per second.
With best regards,
Marcelo