From: David Lechner <dlechner@baylibre.com>
To: surajsonawane0215@gmail.com, Jonathan Cameron <jic23@kernel.org>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] iio: Add IIO_DENSITY channel type
Date: Thu, 12 Jun 2025 11:23:01 -0500 [thread overview]
Message-ID: <9a3731cc-ea6f-45fa-a3e7-c2a33d44ecef@baylibre.com> (raw)
In-Reply-To: <20250612100758.13241-2-surajsonawane0215@gmail.com>
On 6/12/25 5:07 AM, surajsonawane0215@gmail.com wrote:
> From: Suraj Sonawane <surajsonawane0215@gmail.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@gmail.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@vger.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/
next prev parent reply other threads:[~2025-06-12 16:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 10:07 [PATCH v2 0/3] iio: chemical: Add Sharp GP2Y1010AU0F dust sensor support surajsonawane0215
2025-06-12 10:07 ` [PATCH v2 1/3] iio: Add IIO_DENSITY channel type surajsonawane0215
2025-06-12 12:58 ` Andy Shevchenko
2025-06-12 16:23 ` David Lechner [this message]
2025-06-12 10:07 ` [PATCH v2 2/3] dt-bindings: iio: chemical: Add sharp,gp2y1010au0f surajsonawane0215
2025-06-12 10:23 ` Krzysztof Kozlowski
2025-06-12 16:37 ` David Lechner
2025-06-12 10:07 ` [PATCH v2 3/3] iio: chemical: Add driver for Sharp GP2Y1010AU0F surajsonawane0215
2025-06-12 13:15 ` Andy Shevchenko
2025-06-12 18:24 ` David Lechner
2025-06-14 12:33 ` 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=9a3731cc-ea6f-45fa-a3e7-c2a33d44ecef@baylibre.com \
--to=dlechner@baylibre.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=surajsonawane0215@gmail.com \
/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