Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Hermes Zhang <Hermes.Zhang@axis.com>
Cc: <robh@kernel.org>, <lars@metafoo.de>, <krzk+dt@kernel.org>,
	<kernel@axis.com>, <linux-iio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] iio: add IIO_MOD_NOX modifier
Date: Sat, 8 Feb 2025 15:53:46 +0000	[thread overview]
Message-ID: <20250208155346.3fd5a316@jic23-huawei> (raw)
In-Reply-To: <20250206061521.2546108-2-Hermes.Zhang@axis.com>

On Thu, 6 Feb 2025 14:15:15 +0800
Hermes Zhang <Hermes.Zhang@axis.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@axis.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@vger.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;


  reply	other threads:[~2025-02-08 15:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250206061521.2546108-1-Hermes.Zhang@axis.com>
2025-02-06  6:15 ` [PATCH 1/3] iio: add IIO_MOD_NOX modifier Hermes Zhang
2025-02-08 15:53   ` Jonathan Cameron [this message]
2025-02-06  6:15 ` [PATCH 2/3] dt-bindings: iio: chemical: sensirion,senxx: Add yaml description Hermes Zhang
2025-02-06 18:20   ` Conor Dooley
2025-02-08  7:07     ` Hermes Zhang
2025-02-11 18:44       ` Conor Dooley
2025-02-12  6:27         ` Hermes Zhang
2025-02-06  6:15 ` [PATCH 3/3] iio: chemical: add support for Sensirion SEN5x/SEN6x Hermes Zhang
2025-02-08 16:15   ` Jonathan Cameron
2025-02-10  9:16     ` Hermes Zhang
2025-02-10 19:09       ` Jonathan Cameron
2025-02-11  2:29         ` Hermes Zhang
2025-02-11 19:22           ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250208155346.3fd5a316@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Hermes.Zhang@axis.com \
    --cc=kernel@axis.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox