1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/leds-lp55xx.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: TI/National Semiconductor LP55xx and LP8501 LED Drivers
8
9maintainers:
10  - Jacek Anaszewski <jacek.anaszewski@gmail.com>
11  - Pavel Machek <pavel@ucw.cz>
12
13description: |
14  Bindings for the TI/National Semiconductor LP55xx and LP8501 multi channel
15  LED Drivers.
16
17  For more product information please see the link below:
18    https://www.ti.com/lit/gpn/lp5521
19    https://www.ti.com/lit/gpn/lp5523
20    https://www.ti.com/lit/gpn/lp55231
21    https://www.ti.com/lit/gpn/lp5562
22    https://www.ti.com/lit/gpn/lp8501
23
24properties:
25  compatible:
26    enum:
27      - national,lp5521
28      - national,lp5523
29      - ti,lp55231
30      - ti,lp5562
31      - ti,lp8501
32
33  reg:
34    maxItems: 1
35    description: I2C slave address
36
37  clock-mode:
38    $ref: /schemas/types.yaml#definitions/uint8
39    description: |
40      Input clock mode
41    enum:
42      - 0 # automode
43      - 1 # internal
44      - 2 # external
45
46  enable-gpio:
47    maxItems: 1
48    description: |
49      GPIO attached to the chip's enable pin
50
51  pwr-sel:
52    $ref: /schemas/types.yaml#definitions/uint8
53    description: |
54      LP8501 specific property. Power selection for output channels.
55    enum:
56      - 0 # D1~9 are connected to VDD
57      - 1 # D1~6 with VDD, D7~9 with VOUT
58      - 2 # D1~6 with VOUT, D7~9 with VDD
59      - 3 # D1~9 are connected to VOUT
60
61patternProperties:
62  "(^led@[0-9a-f]$|led)":
63    type: object
64    $ref: common.yaml#
65    properties:
66      led-cur:
67        $ref: /schemas/types.yaml#definitions/uint8
68        description: |
69          Current setting at each LED channel (mA x10, 0 if LED is not connected)
70        minimum: 0
71        maximum: 255
72
73      max-cur:
74        $ref: /schemas/types.yaml#definitions/uint8
75        description: Maximun current at each LED channel.
76
77      reg:
78        description: |
79          Output channel for the LED.  This is zero based channel identifier and
80          the data sheet is a one based channel identifier.
81          reg value to output to LED output number
82        enum:
83          - 0 # LED output D1
84          - 1 # LED output D2
85          - 2 # LED output D3
86          - 3 # LED output D4
87          - 4 # LED output D5
88          - 5 # LED output D6
89          - 6 # LED output D7
90          - 7 # LED output D8
91          - 8 # LED output D9
92
93      chan-name:
94        $ref: /schemas/types.yaml#definitions/string
95        description: name of channel
96
97required:
98  - compatible
99  - reg
100
101examples:
102  - |
103   #include <dt-bindings/leds/common.h>
104
105   i2c {
106       #address-cells = <1>;
107       #size-cells = <0>;
108
109       led-controller@32 {
110           #address-cells = <1>;
111           #size-cells = <0>;
112           compatible = "ti,lp8501";
113           reg = <0x32>;
114           clock-mode = /bits/ 8 <2>;
115           pwr-sel = /bits/ 8 <3>;	/* D1~9 connected to VOUT */
116
117           led@0 {
118               reg = <0>;
119               chan-name = "d1";
120               led-cur = /bits/ 8 <0x14>;
121               max-cur = /bits/ 8 <0x20>;
122           };
123
124           led@1 {
125               reg = <1>;
126               chan-name = "d2";
127               led-cur = /bits/ 8 <0x14>;
128               max-cur = /bits/ 8 <0x20>;
129           };
130
131           led@2 {
132               reg = <2>;
133               chan-name = "d3";
134               led-cur = /bits/ 8 <0x14>;
135               max-cur = /bits/ 8 <0x20>;
136           };
137
138           led@3 {
139               reg = <3>;
140               chan-name = "d4";
141               led-cur = /bits/ 8 <0x14>;
142               max-cur = /bits/ 8 <0x20>;
143           };
144
145           led@4 {
146               reg = <4>;
147               chan-name = "d5";
148               led-cur = /bits/ 8 <0x14>;
149               max-cur = /bits/ 8 <0x20>;
150           };
151
152           led@5 {
153               reg = <5>;
154               chan-name = "d6";
155               led-cur = /bits/ 8 <0x14>;
156               max-cur = /bits/ 8 <0x20>;
157           };
158
159           led@6 {
160               reg = <6>;
161               chan-name = "d7";
162               led-cur = /bits/ 8 <0x14>;
163               max-cur = /bits/ 8 <0x20>;
164           };
165
166           led@7 {
167               reg = <7>;
168               chan-name = "d8";
169               led-cur = /bits/ 8 <0x14>;
170               max-cur = /bits/ 8 <0x20>;
171           };
172
173           led@8 {
174               reg = <8>;
175               chan-name = "d9";
176               led-cur = /bits/ 8 <0x14>;
177               max-cur = /bits/ 8 <0x20>;
178           };
179        };
180
181       led-controller@33 {
182           #address-cells = <1>;
183           #size-cells = <0>;
184           compatible = "national,lp5523";
185           reg = <0x33>;
186           clock-mode = /bits/ 8 <0>;
187
188           multi-led@2 {
189               #address-cells = <1>;
190               #size-cells = <0>;
191               reg = <0x2>;
192               color = <LED_COLOR_ID_MULTI>;
193               function = LED_FUNCTION_STANDBY;
194               linux,default-trigger = "heartbeat";
195
196               led@0 {
197                   led-cur = /bits/ 8 <50>;
198                   max-cur = /bits/ 8 <100>;
199                   reg = <0x0>;
200                   color = <LED_COLOR_ID_GREEN>;
201               };
202
203               led@1 {
204                   led-cur = /bits/ 8 <50>;
205                   max-cur = /bits/ 8 <100>;
206                   reg = <0x1>;
207                   color = <LED_COLOR_ID_BLUE>;
208               };
209
210               led@6 {
211                   led-cur = /bits/ 8 <50>;
212                   max-cur = /bits/ 8 <100>;
213                   reg = <0x6>;
214                   color = <LED_COLOR_ID_RED>;
215               };
216            };
217        };
218    };
219
220...
221