[PATCH v2 0/3] iio: chemical: Add Sharp GP2Y1010AU0F dust sensor support
From: surajsonawane0215
Date: Thu Jun 12 2025 - 06:08:47 EST
From: Suraj Sonawane <surajsonawane0215@xxxxxxxxx>
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@xxxxxxxxx/
[PATCH 2/2] https://lore.kernel.org/lkml/20250425221214.50255-1-surajsonawane0215@xxxxxxxxx/
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