Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: iio: chemical: Add sharp,gp2y1010au0f
@ 2025-04-25 21:51 surajsonawane0215
  2025-04-26 10:47 ` Jonathan Cameron
  2025-04-26 11:10 ` Jonathan Cameron
  0 siblings, 2 replies; 3+ messages in thread
From: surajsonawane0215 @ 2025-04-25 21:51 UTC (permalink / raw)
  To: jic23
  Cc: surajsonawane0215, lars, robh, krzk+dt, conor+dt, linux-iio,
	devicetree, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2859 bytes --]

From: Suraj Sonawane <surajsonawane0215@gmail.com>

Add Device Tree bindings for Sharp GP2Y1010AU0F optical dust sensor.
The sensor measures particulate matter concentration via infrared
scattering and requires:

1. GPIO for LED pulse control (280μs pulses with 40μs delay)
2. ADC channel for analog output measurement
3. Power regulator (vdd-supply)

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

Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com>
---
 .../iio/chemical/sharp,gp2y1010au0f.yaml      | 67 +++++++++++++++++++
 1 file changed, 67 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..358c2b2f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/sharp,gp2y1010au0f.yaml
@@ -0,0 +1,67 @@
+# 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@gmail.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
+
+  vdd-supply:
+    description: Phandle to the regulator that provides power to the sensor
+
+  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: Time in microseconds to wait after turning LED on before ADC read
+    default: 40
+    minimum: 0
+    maximum: 100
+
+  sharp,measurement-window-us:
+    description: Measurement window in microseconds after LED turn-on
+    default: 200
+    minimum: 0
+    maximum: 280
+
+required:
+  - compatible
+  - led-gpios
+  - io-channels
+  - io-channel-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dust_sensor {
+        compatible = "sharp,gp2y1010au0f";
+        vdd-supply = <&vcc>;
+        led-gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
+        io-channels = <&adc 0>;
+        io-channel-names = "dust";
+        sharp,led-on-delay-us = <40>;
+        sharp,measurement-window-us = <200>;
+    };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-26 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 21:51 [PATCH 1/2] dt-bindings: iio: chemical: Add sharp,gp2y1010au0f surajsonawane0215
2025-04-26 10:47 ` Jonathan Cameron
2025-04-26 11:10 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox