xref: /linux/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/awinic,aw200xx.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: AWINIC AW200XX LED
8
9maintainers:
10  - Martin Kurbanov <mmkurbanov@sberdevices.ru>
11
12description: |
13  It is a matrix LED driver programmed via an I2C interface. Devices have
14  a set of individually controlled leds and support 3 pattern controllers
15  for auto breathing or group dimming control. Supported devices:
16    - AW20036 (3x12) 36 LEDs
17    - AW20054 (6x9)  54 LEDs
18    - AW20072 (6x12) 72 LEDs
19    - AW20108 (9x12) 108 LEDs
20
21  For more product information please see the link below:
22  aw20036 - https://www.awinic.com/en/productDetail/AW20036QNR#tech-docs
23  aw20054 - https://www.awinic.com/en/productDetail/AW20054QNR#tech-docs
24  aw20072 - https://www.awinic.com/en/productDetail/AW20072QNR#tech-docs
25  aw20108 - https://www.awinic.com/en/productDetail/AW20108QNR#tech-docs
26
27properties:
28  compatible:
29    enum:
30      - awinic,aw20036
31      - awinic,aw20054
32      - awinic,aw20072
33      - awinic,aw20108
34
35  reg:
36    maxItems: 1
37
38  "#address-cells":
39    const: 1
40
41  "#size-cells":
42    const: 0
43
44  enable-gpios:
45    maxItems: 1
46
47patternProperties:
48  "^led@[0-9a-f]+$":
49    type: object
50    $ref: common.yaml#
51    unevaluatedProperties: false
52
53    properties:
54      reg:
55        description:
56          LED number
57        maxItems: 1
58
59      led-max-microamp:
60        default: 9780
61        description: |
62          Note that a driver will take the minimum of all LED limits
63          since the chip has a single global setting.
64          The maximum output current of each LED is calculated by the
65          following formula:
66            IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number)
67          And the minimum output current formula:
68            IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number)
69          where max-current-switch-number is determined by led configuration
70          and depends on how leds are physically connected to the led driver.
71
72allOf:
73  - if:
74      properties:
75        compatible:
76          contains:
77            const: awinic,aw20036
78    then:
79      patternProperties:
80        "^led@[0-9a-f]+$":
81          properties:
82            reg:
83              items:
84                minimum: 0
85                maximum: 36
86
87  - if:
88      properties:
89        compatible:
90          contains:
91            const: awinic,aw20054
92    then:
93      patternProperties:
94        "^led@[0-9a-f]+$":
95          properties:
96            reg:
97              items:
98                minimum: 0
99                maximum: 54
100
101  - if:
102      properties:
103        compatible:
104          contains:
105            const: awinic,aw20072
106    then:
107      patternProperties:
108        "^led@[0-9a-f]+$":
109          properties:
110            reg:
111              items:
112                minimum: 0
113                maximum: 72
114
115  - if:
116      properties:
117        compatible:
118          contains:
119            const: awinic,aw20108
120    then:
121      patternProperties:
122        "^led@[0-9a-f]+$":
123          properties:
124            reg:
125              items:
126                minimum: 0
127                maximum: 108
128
129required:
130  - compatible
131  - reg
132  - "#address-cells"
133  - "#size-cells"
134
135additionalProperties: false
136
137examples:
138  - |
139    #include <dt-bindings/gpio/gpio.h>
140    #include <dt-bindings/leds/common.h>
141
142    i2c {
143        #address-cells = <1>;
144        #size-cells = <0>;
145
146        led-controller@3a {
147            compatible = "awinic,aw20036";
148            reg = <0x3a>;
149            #address-cells = <1>;
150            #size-cells = <0>;
151            enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
152
153            led@0 {
154                reg = <0x0>;
155                color = <LED_COLOR_ID_RED>;
156                led-max-microamp = <9780>;
157            };
158
159            led@1 {
160                reg = <0x1>;
161                color = <LED_COLOR_ID_GREEN>;
162                led-max-microamp = <9780>;
163            };
164
165            led@2 {
166                reg = <0x2>;
167                color = <LED_COLOR_ID_BLUE>;
168                led-max-microamp = <9780>;
169            };
170        };
171    };
172
173...
174