lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250612100758.13241-3-surajsonawane0215@gmail.com>
Date: Thu, 12 Jun 2025 15:37:45 +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 2/3] dt-bindings: iio: chemical: Add sharp,gp2y1010au0f

From: Suraj Sonawane <surajsonawane0215@...il.com>

Add device tree bindings for Sharp GP2Y1010AU0F optical dust sensor.
The sensor measures particulate matter concentration via infrared
scattering with pulsed LED illumination and analog output.

Datasheet: https://global.sharp/products/device/lineup/data/pdf/datasheet/gp2y1010au_appl_e.pdf

Signed-off-by: Suraj Sonawane <surajsonawane0215@...il.com>
---
V1: https://lore.kernel.org/lkml/20250425215149.49068-1-surajsonawane0215@gmail.com/ 
V2: 
- Updated timing properties to match datasheet exactly
- Added reg property for multi-sensor support

 .../iio/chemical/sharp,gp2y1010au0f.yaml      | 78 +++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/sharp,gp2y1010au0f.yaml

diff --git a/Documentation/devicetree/bindings/iio/chemical/sharp,gp2y1010au0f.yaml b/Documentation/devicetree/bindings/iio/chemical/sharp,gp2y1010au0f.yaml
new file mode 100644
index 000000000..b4e5110d0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/sharp,gp2y1010au0f.yaml
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/sharp,gp2y1010au0f.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sharp GP2Y1010AU0F Optical Dust Sensor
+
+maintainers:
+  - Suraj Sonawane <surajsonawane0215@...il.com>
+
+description: |
+  Optical dust sensor measuring particulate matter concentration via infrared scattering.
+  Requires ADC for analog output and GPIO for pulsed LED control with strict timing.
+  Datasheet: https://global.sharp/products/device/lineup/data/pdf/datasheet/gp2y1010au_appl_e.pdf
+
+properties:
+  compatible:
+    const: sharp,gp2y1010au0f
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+
+  led-gpios:
+    description: GPIO connected to the sensor's LED control pin (V-LED)
+    maxItems: 1
+
+  io-channels:
+    description: ADC channel connected to the sensor's analog output (Vo)
+    maxItems: 1
+
+  io-channel-names:
+    const: dust
+
+  sharp,led-on-delay-us:
+    description: |
+      Delay in microseconds after turning the LED ON before reading ADC.
+      The datasheet recommends 280µs after LED ON for accurate measurement.
+      (See Section 6-1 of the datasheet: Sampling timing = 0.28ms)
+
+    default: 280
+    minimum: 0
+    maximum: 320
+
+  sharp,measurement-window-us:
+    description: |
+      Duration in microseconds the LED remains ON for measurement.
+      The recommended pulse width is 320µs ±20µs. (See Section 6-1)
+
+    default: 320
+    minimum: 300
+    maximum: 340
+
+required:
+  - compatible
+  - reg
+  - led-gpios
+  - io-channels
+  - io-channel-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dust_sensor {
+        compatible = "sharp,gp2y1010au0f";
+        reg = <0>;
+        vdd-supply = <&vcc>;
+        led-gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
+        io-channels = <&adc 0>;
+        io-channel-names = "dust";
+        sharp,led-on-delay-us = <280>;
+        sharp,measurement-window-us = <320>;
+    };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ