xref: /freebsd/sys/contrib/device-tree/Bindings/leds/leds-lp55xx.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
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-gpios:
47    maxItems: 1
48    description: |
49      GPIO attached to the chip's enable pin
50
51  label: true
52
53  pwr-sel:
54    $ref: /schemas/types.yaml#/definitions/uint8
55    description: |
56      LP8501 specific property. Power selection for output channels.
57    enum:
58      - 0 # D1~9 are connected to VDD
59      - 1 # D1~6 with VDD, D7~9 with VOUT
60      - 2 # D1~6 with VOUT, D7~9 with VDD
61      - 3 # D1~9 are connected to VOUT
62
63  '#address-cells':
64    const: 1
65
66  '#size-cells':
67    const: 0
68
69patternProperties:
70  '^multi-led@[0-8]$':
71    type: object
72    $ref: leds-class-multicolor.yaml#
73    unevaluatedProperties: false
74
75    properties:
76      reg:
77        maximum: 8
78
79      '#address-cells':
80        const: 1
81
82      '#size-cells':
83        const: 0
84
85    patternProperties:
86      "^led@[0-8]$":
87        type: object
88        $ref: common.yaml#
89        unevaluatedProperties: false
90
91        properties:
92          led-cur:
93            $ref: /schemas/types.yaml#/definitions/uint8
94            description: |
95              Current setting at each LED channel (mA x10, 0 if LED is not connected)
96            minimum: 0
97            maximum: 255
98
99          max-cur:
100            $ref: /schemas/types.yaml#/definitions/uint8
101            description: Maximun current at each LED channel.
102
103          reg:
104            maximum: 8
105
106        required:
107          - reg
108
109  "^led@[0-8]$":
110    type: object
111    $ref: common.yaml#
112    unevaluatedProperties: false
113
114    properties:
115      led-cur:
116        $ref: /schemas/types.yaml#/definitions/uint8
117        description: |
118          Current setting at each LED channel (mA x10, 0 if LED is not connected)
119        minimum: 0
120        maximum: 255
121
122      max-cur:
123        $ref: /schemas/types.yaml#/definitions/uint8
124        description: Maximun current at each LED channel.
125
126      reg:
127        description: |
128          Output channel for the LED.  This is zero based channel identifier and
129          the data sheet is a one based channel identifier.
130          reg value to output to LED output number
131        enum:
132          - 0 # LED output D1
133          - 1 # LED output D2
134          - 2 # LED output D3
135          - 3 # LED output D4
136          - 4 # LED output D5
137          - 5 # LED output D6
138          - 6 # LED output D7
139          - 7 # LED output D8
140          - 8 # LED output D9
141
142      chan-name:
143        $ref: /schemas/types.yaml#/definitions/string
144        description: name of channel
145
146required:
147  - compatible
148  - reg
149
150additionalProperties: false
151
152examples:
153  - |
154    #include <dt-bindings/leds/common.h>
155
156    i2c {
157        #address-cells = <1>;
158        #size-cells = <0>;
159
160        led-controller@32 {
161            #address-cells = <1>;
162            #size-cells = <0>;
163            compatible = "ti,lp8501";
164            reg = <0x32>;
165            clock-mode = /bits/ 8 <2>;
166            pwr-sel = /bits/ 8 <3>;	/* D1~9 connected to VOUT */
167
168            led@0 {
169                reg = <0>;
170                chan-name = "d1";
171                led-cur = /bits/ 8 <0x14>;
172                max-cur = /bits/ 8 <0x20>;
173            };
174
175            led@1 {
176                reg = <1>;
177                chan-name = "d2";
178                led-cur = /bits/ 8 <0x14>;
179                max-cur = /bits/ 8 <0x20>;
180            };
181
182            led@2 {
183                reg = <2>;
184                chan-name = "d3";
185                led-cur = /bits/ 8 <0x14>;
186                max-cur = /bits/ 8 <0x20>;
187            };
188
189            led@3 {
190                reg = <3>;
191                chan-name = "d4";
192                led-cur = /bits/ 8 <0x14>;
193                max-cur = /bits/ 8 <0x20>;
194            };
195
196            led@4 {
197                reg = <4>;
198                chan-name = "d5";
199                led-cur = /bits/ 8 <0x14>;
200                max-cur = /bits/ 8 <0x20>;
201            };
202
203            led@5 {
204                reg = <5>;
205                chan-name = "d6";
206                led-cur = /bits/ 8 <0x14>;
207                max-cur = /bits/ 8 <0x20>;
208            };
209
210            led@6 {
211                reg = <6>;
212                chan-name = "d7";
213                led-cur = /bits/ 8 <0x14>;
214                max-cur = /bits/ 8 <0x20>;
215            };
216
217            led@7 {
218                reg = <7>;
219                chan-name = "d8";
220                led-cur = /bits/ 8 <0x14>;
221                max-cur = /bits/ 8 <0x20>;
222            };
223
224            led@8 {
225                reg = <8>;
226                chan-name = "d9";
227                led-cur = /bits/ 8 <0x14>;
228                max-cur = /bits/ 8 <0x20>;
229            };
230        };
231
232        led-controller@33 {
233            #address-cells = <1>;
234            #size-cells = <0>;
235            compatible = "national,lp5523";
236            reg = <0x33>;
237            clock-mode = /bits/ 8 <0>;
238
239            multi-led@2 {
240                #address-cells = <1>;
241                #size-cells = <0>;
242                reg = <0x2>;
243                color = <LED_COLOR_ID_RGB>;
244                function = LED_FUNCTION_STANDBY;
245                linux,default-trigger = "heartbeat";
246
247                led@0 {
248                    led-cur = /bits/ 8 <50>;
249                    max-cur = /bits/ 8 <100>;
250                    reg = <0x0>;
251                    color = <LED_COLOR_ID_GREEN>;
252                };
253
254                led@1 {
255                    led-cur = /bits/ 8 <50>;
256                    max-cur = /bits/ 8 <100>;
257                    reg = <0x1>;
258                    color = <LED_COLOR_ID_BLUE>;
259                };
260
261                led@6 {
262                    led-cur = /bits/ 8 <50>;
263                    max-cur = /bits/ 8 <100>;
264                    reg = <0x6>;
265                    color = <LED_COLOR_ID_RED>;
266                };
267            };
268        };
269    };
270
271...
272