diff mbox series

[v1,1/2] dt-bindings: iio: light: add apds990x binding

Message ID 20230731110239.107086-2-clamor95@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series Update APDS990x ALS to support device trees | expand

Commit Message

Svyatoslav Ryhel July 31, 2023, 11:02 a.m. UTC
Add dt-binding for apds990x ambient light/proximity sensor.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 .../bindings/iio/light/avago,apds990x.yaml    | 87 +++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml

Comments

Arnd Bergmann July 31, 2023, 1:23 p.m. UTC | #1
On Mon, Jul 31, 2023, at 13:02, Svyatoslav Ryhel wrote:

> +---
> +$id: http://devicetree.org/schemas/iio/light/avago,apds990x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Avago APDS990x ambient light and proximity sensor
> +

The APDS990x looks like a wildcard, which is not appropriate for
the "compatible" property in DT, and should be replaced with a list
of specific part numbers to which this applies.

    Arnd
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml
new file mode 100644
index 000000000000..89a061643de5
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/avago,apds990x.yaml
@@ -0,0 +1,87 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/avago,apds990x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Avago APDS990x ambient light and proximity sensor
+
+maintainers:
+  - Samu Onkalo <samu.p.onkalo@nokia.com>
+
+description:
+  APDS990x is a combined ambient light and proximity sensor. ALS and
+  proximity functionality are highly connected. ALS measurement path
+  must be running while the proximity functionality is enabled.
+  Datasheet at https://docs.broadcom.com/doc/AV02-2867EN
+
+properties:
+  compatible:
+    const: avago,apds990x
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply: true
+  vled-supply: true
+
+  avago,pdrive:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 3
+    description:
+      The LED drive current is controlled by a regulated current
+      sink on the LDR pin. This feature eliminates the need to use
+      a current limiting resistor to control LED current. The LED
+      drive current can be configured for 12.5 mA (pdrive = 3),
+      25 mA (2), 50 mA (1) or 100 mA (0). For higher LED drive
+      requirements, an external P type transistor can be used to
+      control the LED current.
+
+  avago,ppcount:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 1
+    maximum: 255
+    description:
+      The number of LED pulses can be programmed to a value of 1 to
+      255 pulses as needed. Increasing the number of LED pulses at a
+      given current will increase the sensor sensitivity. Sensitivity
+      grows by the square root of the number of pulses. Each pulse
+      has a 16 mS period.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vdd-supply
+  - vled-supply
+  - avago,pdrive
+  - avago,ppcount
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@39 {
+            compatible = "avago,apds990x";
+            reg = <0x39>;
+
+            interrupt-parent = <&gpio>;
+            interrupts = <82 IRQ_TYPE_EDGE_RISING>;
+
+            vdd-supply = <&vdd_3v0_proxi>;
+            vled-supply = <&vdd_1v8_sen>;
+
+            avago,pdrive = <0>;
+            avago,ppcount = <3>;
+        };
+    };
+...