iio: types: add IIO_VOLUMEFLOW channel type

Add a new IIO channel type for liquid volumetric flow sensors.  The
unit exposed via the standard _scale attribute is cubic metres per
second (m^3/s), following the SI convention used by the other IIO
channel types.

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@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
Wadim Mueller
2026-07-28 23:49:40 +02:00
committed by Jonathan Cameron
parent ce717fbfda
commit 22bba9dfd2
4 changed files with 15 additions and 0 deletions

View File

@@ -508,6 +508,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@vger.kernel.org
Description:
@@ -2498,3 +2500,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: 7.3
Contact: linux-iio@vger.kernel.org
Description:
Raw (unscaled) volumetric flow rate reading from the channel.
To convert to standard units (cubic metres per second, m^3/s)
apply the channel's _scale (and _offset, when present).

View File

@@ -99,6 +99,7 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_ATTENTION] = "attention",
[IIO_ALTCURRENT] = "altcurrent",
[IIO_COVERAGE] = "coverage",
[IIO_VOLUMEFLOW] = "volumeflow",
};
static const char * const iio_modifier_names[] = {

View File

@@ -54,6 +54,7 @@ enum iio_chan_type {
IIO_ATTENTION,
IIO_ALTCURRENT,
IIO_COVERAGE,
IIO_VOLUMEFLOW,
};
enum iio_modifier {

View File

@@ -66,6 +66,7 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_ATTENTION] = "attention",
[IIO_ALTCURRENT] = "altcurrent",
[IIO_COVERAGE] = "coverage",
[IIO_VOLUMEFLOW] = "volumeflow",
};
static const char * const iio_ev_type_text[] = {
@@ -196,6 +197,7 @@ static bool event_is_known(struct iio_event_data *event)
case IIO_ATTENTION:
case IIO_ALTCURRENT:
case IIO_COVERAGE:
case IIO_VOLUMEFLOW:
break;
default:
return false;