1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/light/ti,opt4001.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Texas Instruments OPT4001 Ambient Light Sensor
8
9maintainers:
10  - Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com>
11
12description:
13  Ambient light sensor with an i2c interface.
14  Last part of compatible is for the packaging used.
15  Picostar is a 4 pinned SMT and sot-5x3 is a 8 pinned SOT.
16  https://www.ti.com/lit/gpn/opt4001
17
18properties:
19  compatible:
20    enum:
21      - ti,opt4001-picostar
22      - ti,opt4001-sot-5x3
23
24  reg:
25    maxItems: 1
26
27  interrupts:
28    maxItems: 1
29
30  vdd-supply:
31    description: Regulator that provides power to the sensor
32
33required:
34  - compatible
35  - reg
36
37allOf:
38  - if:
39      properties:
40        compatible:
41          contains:
42            const: ti,opt4001-sot-5x3
43    then:
44      properties:
45        interrupts:
46          maxItems: 1
47    else:
48      properties:
49        interrupts: false
50
51additionalProperties: false
52
53examples:
54  - |
55    #include <dt-bindings/interrupt-controller/irq.h>
56    i2c {
57        #address-cells = <1>;
58        #size-cells = <0>;
59
60        light-sensor@44 {
61            compatible = "ti,opt4001-sot-5x3";
62            reg = <0x44>;
63            vdd-supply = <&vdd_reg>;
64            interrupt-parent = <&gpio1>;
65            interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
66        };
67    };
68...
69