Re: [PATCH v3 1/3] iio: types: add IIO_VOLUMEFLOW channel type

From: Jonathan Cameron

Date: Mon Jun 01 2026 - 05:53:35 EST


On Sun, 31 May 2026 15:09:54 -0300
Marcelo Schmitt <marcelo.schmitt1@xxxxxxxxx> wrote:

> 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.

I don't think that discussion ever finished. Please makes sure to capture open
questions like this in your cover letter. A comment in the individual patch / code
is also appropriate so people don't miss it.


J

>
> With best regards,
> Marcelo