[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a3731cc-ea6f-45fa-a3e7-c2a33d44ecef@baylibre.com>
Date: Thu, 12 Jun 2025 11:23:01 -0500
From: David Lechner <dlechner@...libre.com>
To: surajsonawane0215@...il.com, Jonathan Cameron <jic23@...nel.org>
Cc: Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] iio: Add IIO_DENSITY channel type
On 6/12/25 5:07 AM, surajsonawane0215@...il.com wrote:
> From: Suraj Sonawane <surajsonawane0215@...il.com>
>
> Add IIO_DENSITY channel type for particulate matter sensors,
> with base units of grams per cubic meter (g/m³). This is needed
> for optical dust sensors like the Sharp GP2Y1010AU0F that measure
> airborne particle concentration rather than raw voltage.
>
> Signed-off-by: Suraj Sonawane <surajsonawane0215@...il.com>
> ---
> V2: Initial version introducing IIO_DENSITY channel type
>
> Documentation/ABI/testing/sysfs-bus-iio | 8 ++++++++
> include/uapi/linux/iio/types.h | 1 +
> 2 files changed, 9 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 190bfcc1e..9b1b538ce 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -2383,3 +2383,11 @@ Description:
> Value representing the user's attention to the system expressed
> in units as percentage. This usually means if the user is
> looking at the screen or not.
> +
> +What: /sys/bus/iio/devices/iio:deviceX/in_density_raw
> +KernelVersion: 6.15
> +Contact: linux-iio@...r.kernel.org
> +Description:
> + Raw reading from an optical dust sensor.
> + This value is proportional to dust density in air,
I don't see why density would be specific to dust. We could make
this description more generic.
> + with base units of g/m^3.
> +
> diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
> index 3eb0821af..e7d09ec0b 100644
> --- a/include/uapi/linux/iio/types.h
> +++ b/include/uapi/linux/iio/types.h
> @@ -37,6 +37,7 @@ enum iio_chan_type {
> IIO_DISTANCE,
> IIO_VELOCITY,
> IIO_CONCENTRATION,
> + IIO_DENSITY,
This is part of the userspace ABI, new items have to be added
to the end. We can't change the meaning of the numeric values.
> IIO_RESISTANCE,
> IIO_PH,
> IIO_UVINDEX,
There are also a couple more places where this new channel needs
be added as well. See [1] for an example (although density probably
doesn't need to be added to known events).
[1]: https://lore.kernel.org/all/20241101-hpd-v3-3-e9c80b7c7164@chromium.org/
Powered by blists - more mailing lists