[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250208155346.3fd5a316@jic23-huawei>
Date: Sat, 8 Feb 2025 15:53:46 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Hermes Zhang <Hermes.Zhang@...s.com>
Cc: <robh@...nel.org>, <lars@...afoo.de>, <krzk+dt@...nel.org>,
<kernel@...s.com>, <linux-iio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] iio: add IIO_MOD_NOX modifier
On Thu, 6 Feb 2025 14:15:15 +0800
Hermes Zhang <Hermes.Zhang@...s.com> wrote:
> Add modifier IIO_MOD_NOX for NOx concentration reporting. NOx (a generic
> term for the mono-nitrogen oxides) are used in environment sensor as a
> parameter to show the concentration in index format.
>
> An example case: https://www.sensirion.com/media/documents/9F289B95/
> 6294DFFC/Info_Note_NOx_Index.pdf
Use a Link tag directly at the top of the tag block (no blank line between
it and your SoB)
>
> Signed-off-by: Hermes Zhang <Hermes.Zhang@...s.com>
> ---
> Documentation/ABI/testing/sysfs-bus-iio | 2 ++
> drivers/iio/industrialio-core.c | 1 +
> include/uapi/linux/iio/types.h | 1 +
> tools/iio/iio_event_monitor.c | 2 ++
> 4 files changed, 6 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index f83bd6829285..c7d54dc1f226 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1898,6 +1898,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_concentration_o2_raw
> What: /sys/bus/iio/devices/iio:deviceX/in_concentrationX_o2_raw
> What: /sys/bus/iio/devices/iio:deviceX/in_concentration_voc_raw
> What: /sys/bus/iio/devices/iio:deviceX/in_concentrationX_voc_raw
> +What: /sys/bus/iio/devices/iio:deviceX/in_concentration_nox_raw
> +What: /sys/bus/iio/devices/iio:deviceX/in_concentrationX_nox_raw
This section defines the units as percent. Given the link above, this nox value
seems very much to not be in percent and arguably isn't a concentration measure
or if I read that right even a scaled value of that.
I'm not sure how we handle this in a consistent fashion :(
At very least needs a new documentation block with the details of these units.
This a raw attribute so it doesn't have to be possible to scale it to a 'standard'
unit (light color sensors / intensity channels for a similar example).
Is it possible to compare readings off sensors from different companies?
> KernelVersion: 4.3
> Contact: linux-iio@...r.kernel.org
> Description:
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index a2117ad1337d..6a85688c9148 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -151,6 +151,7 @@ static const char * const iio_modifier_names[] = {
> [IIO_MOD_PITCH] = "pitch",
> [IIO_MOD_YAW] = "yaw",
> [IIO_MOD_ROLL] = "roll",
> + [IIO_MOD_NOX] = "nox",
> };
>
> /* relies on pairs of these shared then separate */
> diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
> index 12886d4465e4..f7dfc4c71495 100644
> --- a/include/uapi/linux/iio/types.h
> +++ b/include/uapi/linux/iio/types.h
> @@ -108,6 +108,7 @@ enum iio_modifier {
> IIO_MOD_ROLL,
> IIO_MOD_LIGHT_UVA,
> IIO_MOD_LIGHT_UVB,
> + IIO_MOD_NOX,
> };
>
> enum iio_event_type {
> diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
> index cccf62ea2b8f..51c6f753e7d4 100644
> --- a/tools/iio/iio_event_monitor.c
> +++ b/tools/iio/iio_event_monitor.c
> @@ -138,6 +138,7 @@ static const char * const iio_modifier_names[] = {
> [IIO_MOD_PITCH] = "pitch",
> [IIO_MOD_YAW] = "yaw",
> [IIO_MOD_ROLL] = "roll",
> + [IIO_MOD_NOX] = "nox",
> };
>
> static bool event_is_known(struct iio_event_data *event)
> @@ -236,6 +237,7 @@ static bool event_is_known(struct iio_event_data *event)
> case IIO_MOD_PM4:
> case IIO_MOD_PM10:
> case IIO_MOD_O2:
> + case IIO_MOD_NOX:
> break;
> default:
> return false;
Powered by blists - more mailing lists