blob: 54d6d1f08e2489d91d104a89df31cbc31e823f2c [file] [log] [blame]
Tom Rini53633a82024-02-29 12:33:36 -05001# 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: |
Tom Rini93743d22024-04-01 09:08:13 -040013 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
Tom Rini53633a82024-02-29 12:33:36 -050020
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
Tom Rini93743d22024-04-01 09:08:13 -040025 aw20108 - https://www.awinic.com/en/productDetail/AW20108QNR#tech-docs
Tom Rini53633a82024-02-29 12:33:36 -050026
27properties:
28 compatible:
29 enum:
30 - awinic,aw20036
31 - awinic,aw20054
32 - awinic,aw20072
Tom Rini93743d22024-04-01 09:08:13 -040033 - awinic,aw20108
Tom Rini53633a82024-02-29 12:33:36 -050034
35 reg:
36 maxItems: 1
37
38 "#address-cells":
39 const: 1
40
41 "#size-cells":
42 const: 0
43
Tom Rini93743d22024-04-01 09:08:13 -040044 enable-gpios:
45 maxItems: 1
Tom Rini53633a82024-02-29 12:33:36 -050046
47patternProperties:
Tom Rini93743d22024-04-01 09:08:13 -040048 "^led@[0-9a-f]+$":
Tom Rini53633a82024-02-29 12:33:36 -050049 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:
Tom Rini93743d22024-04-01 09:08:13 -040066 IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number)
Tom Rini53633a82024-02-29 12:33:36 -050067 And the minimum output current formula:
Tom Rini93743d22024-04-01 09:08:13 -040068 IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number)
69 where max-current-switch-number is determinated by led configuration
70 and depends on how leds are physically connected to the led driver.
Tom Rini53633a82024-02-29 12:33:36 -050071
72allOf:
73 - if:
74 properties:
75 compatible:
76 contains:
77 const: awinic,aw20036
78 then:
Tom Rini93743d22024-04-01 09:08:13 -040079 patternProperties:
80 "^led@[0-9a-f]+$":
81 properties:
82 reg:
83 items:
84 minimum: 0
85 maximum: 36
86
87 - if:
Tom Rini53633a82024-02-29 12:33:36 -050088 properties:
Tom Rini93743d22024-04-01 09:08:13 -040089 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:
Tom Rini53633a82024-02-29 12:33:36 -0500102 properties:
Tom Rini93743d22024-04-01 09:08:13 -0400103 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"
Tom Rini53633a82024-02-29 12:33:36 -0500134
135additionalProperties: false
136
137examples:
138 - |
Tom Rini93743d22024-04-01 09:08:13 -0400139 #include <dt-bindings/gpio/gpio.h>
Tom Rini53633a82024-02-29 12:33:36 -0500140 #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>;
Tom Rini93743d22024-04-01 09:08:13 -0400151 enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
Tom Rini53633a82024-02-29 12:33:36 -0500152
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...