[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250612100758.13241-1-surajsonawane0215@gmail.com>
Date: Thu, 12 Jun 2025 15:37:43 +0530
From: surajsonawane0215@...il.com
To: Jonathan Cameron <jic23@...nel.org>
Cc: David Lechner <dlechner@...libre.com>,
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,
surajsonawane0215@...il.com
Subject: [PATCH v2 0/3] iio: chemical: Add Sharp GP2Y1010AU0F dust sensor support
From: Suraj Sonawane <surajsonawane0215@...il.com>
This patch series adds support for the Sharp GP2Y1010AU0F optical
dust sensor, which measures airborne particulate matter concentration
in grams per cubic meter (g/m³). The implementation includes:
1. A new IIO_DENSITY channel type for particulate sensors (Patch 1)
2. Device tree bindings documentation (Patch 2)
3. The driver implementation (Patch 3)
The sensor requires:
- One GPIO for device enable control
- One ADC channel for analog output measurement
- Optional LED trigger for synchronized sampling
Tested on BeagleBone Black with:
- P8_12 (GPIO_44) for LED control
- P9_39 (AIN0) for analog output
Changes since v1:
- Added new IIO_DENSITY channel type (Patch 1)
- Documented ABI for density measurements (g/m³) in sysfs-bus-iio
- Updated timing properties to match datasheet:
* sharp,led-on-delay-us: 280μs (from 40μs)
* sharp,measurement-window-us: 280μs (from 200μs)
- Added reg property for multi-sensor support
- Moved datasheet reference to tags block
- Hardware Interface:
* Replaced manual power management with devm_regulator_get_enabled()
* Consolidated LED timing into single delay operation
* Improved error handling in read sequence
- Removed unnecessary IIO_BUFFER dependencies
- Alphabetized Makefile entry and header includes
- Replaced extend_name with proper label callback
- Standardized on pdev->dev for all device logging
- Applied IIO formatting conventions ({ } spacing)
- Changed IIO_VOLTAGE → IIO_DENSITY channel type
- Updated all timing values to datasheet specifications
V1: [PATCH 1/2] https://lore.kernel.org/lkml/20250425215149.49068-1-surajsonawane0215@gmail.com/
[PATCH 2/2] https://lore.kernel.org/lkml/20250425221214.50255-1-surajsonawane0215@gmail.com/
Thanks!
Suraj Sonawane
Suraj Sonawane (3):
iio: Add IIO_DENSITY channel type
dt-bindings: iio: chemical: Add sharp,gp2y1010au0f
iio: chemical: Add driver for Sharp GP2Y1010AU0F
Documentation/ABI/testing/sysfs-bus-iio | 8 ++
.../iio/chemical/sharp,gp2y1010au0f.yaml | 78 +++++++++++
MAINTAINERS | 7 +
drivers/iio/chemical/Kconfig | 10 ++
drivers/iio/chemical/Makefile | 1 +
drivers/iio/chemical/gp2y1010.c | 126 ++++++++++++++++++
include/uapi/linux/iio/types.h | 1 +
7 files changed, 231 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/chemical/sharp,gp2y1010au0f.yaml
create mode 100644 drivers/iio/chemical/gp2y1010.c
--
2.43.0
Powered by blists - more mailing lists