xref: /linux/Documentation/devicetree/bindings/leds/nxp,pca963x.yaml (revision 49bda4826843be0ef97a162009a29ea3a63f3935)
1a004f242SLaurent Pinchart# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2a004f242SLaurent Pinchart%YAML 1.2
3a004f242SLaurent Pinchart---
4a004f242SLaurent Pinchart$id: http://devicetree.org/schemas/leds/nxp,pca963x.yaml#
5a004f242SLaurent Pinchart$schema: http://devicetree.org/meta-schemas/core.yaml#
6a004f242SLaurent Pinchart
7a004f242SLaurent Pincharttitle: NXP PCA963x LED controllers
8a004f242SLaurent Pinchart
9a004f242SLaurent Pinchartmaintainers:
10a004f242SLaurent Pinchart  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
11a004f242SLaurent Pinchart
12a004f242SLaurent Pinchartdescription: |
13a004f242SLaurent Pinchart  The NXP PCA963x are I2C-controlled LED drivers optimized for
14a004f242SLaurent Pinchart  Red/Green/Blue/Amber (RGBA) color mixing applications. Each LED is
15a004f242SLaurent Pinchart  individually controllable and has its own PWM controller.
16a004f242SLaurent Pinchart
17a004f242SLaurent Pinchart  Datasheets are available at
18a004f242SLaurent Pinchart
19a004f242SLaurent Pinchart  - https://www.nxp.com/docs/en/data-sheet/PCA9632.pdf
20a004f242SLaurent Pinchart  - https://www.nxp.com/docs/en/data-sheet/PCA9633.pdf
21a004f242SLaurent Pinchart  - https://www.nxp.com/docs/en/data-sheet/PCA9634.pdf
22a004f242SLaurent Pinchart  - https://www.nxp.com/docs/en/data-sheet/PCA9635.pdf
23a004f242SLaurent Pinchart
24a004f242SLaurent Pinchartproperties:
25a004f242SLaurent Pinchart  compatible:
26a004f242SLaurent Pinchart    enum:
27a004f242SLaurent Pinchart      - nxp,pca9632
28a004f242SLaurent Pinchart      - nxp,pca9633
29a004f242SLaurent Pinchart      - nxp,pca9634
30a004f242SLaurent Pinchart      - nxp,pca9635
31a004f242SLaurent Pinchart
32a004f242SLaurent Pinchart  reg:
33a004f242SLaurent Pinchart    maxItems: 1
34a004f242SLaurent Pinchart
35a004f242SLaurent Pinchart  "#address-cells":
36a004f242SLaurent Pinchart    const: 1
37a004f242SLaurent Pinchart
38a004f242SLaurent Pinchart  "#size-cells":
39a004f242SLaurent Pinchart    const: 0
40a004f242SLaurent Pinchart
41a004f242SLaurent Pinchart  nxp,hw-blink:
42a004f242SLaurent Pinchart    type: boolean
43a004f242SLaurent Pinchart    description:
44a004f242SLaurent Pinchart      Use hardware blinking instead of software blinking
45a004f242SLaurent Pinchart
46a004f242SLaurent Pinchart  nxp,inverted-out:
47a004f242SLaurent Pinchart    type: boolean
48a004f242SLaurent Pinchart    description:
49a004f242SLaurent Pinchart      Invert the polarity of the generated PWM.
50a004f242SLaurent Pinchart
51a004f242SLaurent Pinchart  nxp,period-scale:
52a004f242SLaurent Pinchart    $ref: /schemas/types.yaml#/definitions/uint32
53a004f242SLaurent Pinchart    description:
54a004f242SLaurent Pinchart      In some configurations, the chip blinks faster than expected. This
55a004f242SLaurent Pinchart      parameter provides a scaling ratio (fixed point, decimal divided by 1000)
56a004f242SLaurent Pinchart      to compensate, e.g. 1300=1.3x and 750=0.75x.
57a004f242SLaurent Pinchart
58a004f242SLaurent Pinchart  nxp,totem-pole:
59a004f242SLaurent Pinchart    type: boolean
60a004f242SLaurent Pinchart    description:
61a004f242SLaurent Pinchart      Use totem pole (push-pull) instead of open-drain (pca9632 defaults to
62a004f242SLaurent Pinchart      open-drain, newer chips to totem pole).
63a004f242SLaurent Pinchart
64a004f242SLaurent PinchartpatternProperties:
65b765b508SLoic Poulain  "^led@[0-9a-f]$":
66a004f242SLaurent Pinchart    type: object
67a004f242SLaurent Pinchart    $ref: common.yaml#
68a004f242SLaurent Pinchart    unevaluatedProperties: false
69a004f242SLaurent Pinchart
70a004f242SLaurent Pinchart    properties:
71a004f242SLaurent Pinchart      reg:
72b765b508SLoic Poulain        maximum: 15
73a004f242SLaurent Pinchart
74a004f242SLaurent Pinchart    required:
75a004f242SLaurent Pinchart      - reg
76a004f242SLaurent Pinchart
77*160c78e6SLoic Poulain  "^multi-led@[0-9a-f]$":
78*160c78e6SLoic Poulain    type: object
79*160c78e6SLoic Poulain    $ref: leds-class-multicolor.yaml#
80*160c78e6SLoic Poulain    unevaluatedProperties: false
81*160c78e6SLoic Poulain
82*160c78e6SLoic Poulain    properties:
83*160c78e6SLoic Poulain      reg:
84*160c78e6SLoic Poulain        maximum: 15
85*160c78e6SLoic Poulain
86*160c78e6SLoic Poulain      "#address-cells":
87*160c78e6SLoic Poulain        const: 1
88*160c78e6SLoic Poulain
89*160c78e6SLoic Poulain      "#size-cells":
90*160c78e6SLoic Poulain        const: 0
91*160c78e6SLoic Poulain
92*160c78e6SLoic Poulain    patternProperties:
93*160c78e6SLoic Poulain      "^led@[0-9a-f]$":
94*160c78e6SLoic Poulain        type: object
95*160c78e6SLoic Poulain        $ref: common.yaml#
96*160c78e6SLoic Poulain        unevaluatedProperties: false
97*160c78e6SLoic Poulain
98*160c78e6SLoic Poulain        properties:
99*160c78e6SLoic Poulain          reg:
100*160c78e6SLoic Poulain            maximum: 15
101*160c78e6SLoic Poulain
102*160c78e6SLoic Poulain        required:
103*160c78e6SLoic Poulain          - reg
104*160c78e6SLoic Poulain          - color
105*160c78e6SLoic Poulain
106*160c78e6SLoic Poulain    required:
107*160c78e6SLoic Poulain      - reg
108*160c78e6SLoic Poulain      - "#address-cells"
109*160c78e6SLoic Poulain      - "#size-cells"
110*160c78e6SLoic Poulain
111a004f242SLaurent PinchartallOf:
112a004f242SLaurent Pinchart  - if:
113a004f242SLaurent Pinchart      properties:
114a004f242SLaurent Pinchart        compatible:
115a004f242SLaurent Pinchart          contains:
116a004f242SLaurent Pinchart            enum:
117a004f242SLaurent Pinchart              - nxp,pca9632
118a004f242SLaurent Pinchart              - nxp,pca9633
119a004f242SLaurent Pinchart    then:
120a004f242SLaurent Pinchart      patternProperties:
121*160c78e6SLoic Poulain        "^.*led@[0-9a-f]$":
122*160c78e6SLoic Poulain          properties:
123*160c78e6SLoic Poulain            reg:
124*160c78e6SLoic Poulain              maximum: 3
125*160c78e6SLoic Poulain        "^multi-led@[0-9a-f]$":
126*160c78e6SLoic Poulain          patternProperties:
127*160c78e6SLoic Poulain            "^led@[0-9a-f]$":
128a004f242SLaurent Pinchart              properties:
129a004f242SLaurent Pinchart                reg:
130a004f242SLaurent Pinchart                  maximum: 3
131b765b508SLoic Poulain  - if:
132b765b508SLoic Poulain      properties:
133b765b508SLoic Poulain        compatible:
134b765b508SLoic Poulain          contains:
135b765b508SLoic Poulain            enum:
136b765b508SLoic Poulain              - nxp,pca9634
137b765b508SLoic Poulain    then:
138a004f242SLaurent Pinchart      patternProperties:
139*160c78e6SLoic Poulain        "^.*led@[0-9a-f]$":
140*160c78e6SLoic Poulain          properties:
141*160c78e6SLoic Poulain            reg:
142*160c78e6SLoic Poulain              maximum: 7
143*160c78e6SLoic Poulain        "^multi-led@[0-9a-f]$":
144*160c78e6SLoic Poulain          patternProperties:
145*160c78e6SLoic Poulain            "^led@[0-9a-f]$":
146a004f242SLaurent Pinchart              properties:
147a004f242SLaurent Pinchart                reg:
148a004f242SLaurent Pinchart                  maximum: 7
149a004f242SLaurent Pinchart
150a004f242SLaurent PinchartadditionalProperties: false
151a004f242SLaurent Pinchart
152a004f242SLaurent Pinchartexamples:
153a004f242SLaurent Pinchart  - |
154a004f242SLaurent Pinchart    #include <dt-bindings/leds/common.h>
155a004f242SLaurent Pinchart
156a004f242SLaurent Pinchart    i2c {
157a004f242SLaurent Pinchart        #address-cells = <1>;
158a004f242SLaurent Pinchart        #size-cells = <0>;
159a004f242SLaurent Pinchart
160a004f242SLaurent Pinchart        led-controller@62 {
161a004f242SLaurent Pinchart            compatible = "nxp,pca9632";
162a004f242SLaurent Pinchart            reg = <0x62>;
163a004f242SLaurent Pinchart            #address-cells = <1>;
164a004f242SLaurent Pinchart            #size-cells = <0>;
165a004f242SLaurent Pinchart
166a004f242SLaurent Pinchart            led@0 {
167a004f242SLaurent Pinchart                    reg = <0>;
168a004f242SLaurent Pinchart                    color = <LED_COLOR_ID_RED>;
169a004f242SLaurent Pinchart                    function = LED_FUNCTION_STATUS;
170a004f242SLaurent Pinchart            };
171a004f242SLaurent Pinchart
172a004f242SLaurent Pinchart            led@1 {
173a004f242SLaurent Pinchart                    reg = <1>;
174a004f242SLaurent Pinchart                    color = <LED_COLOR_ID_GREEN>;
175a004f242SLaurent Pinchart                    function = LED_FUNCTION_STATUS;
176a004f242SLaurent Pinchart            };
177a004f242SLaurent Pinchart
178a004f242SLaurent Pinchart            led@2 {
179a004f242SLaurent Pinchart                    reg = <2>;
180a004f242SLaurent Pinchart                    color = <LED_COLOR_ID_BLUE>;
181a004f242SLaurent Pinchart                    function = LED_FUNCTION_STATUS;
182a004f242SLaurent Pinchart            };
183a004f242SLaurent Pinchart
184a004f242SLaurent Pinchart            led@3 {
185a004f242SLaurent Pinchart                    reg = <3>;
186a004f242SLaurent Pinchart                    color = <LED_COLOR_ID_WHITE>;
187a004f242SLaurent Pinchart                    function = LED_FUNCTION_STATUS;
188a004f242SLaurent Pinchart            };
189a004f242SLaurent Pinchart        };
190a004f242SLaurent Pinchart    };
191a004f242SLaurent Pinchart
192*160c78e6SLoic Poulain  - |
193*160c78e6SLoic Poulain    #include <dt-bindings/leds/common.h>
194*160c78e6SLoic Poulain
195*160c78e6SLoic Poulain    i2c {
196*160c78e6SLoic Poulain        #address-cells = <1>;
197*160c78e6SLoic Poulain        #size-cells = <0>;
198*160c78e6SLoic Poulain
199*160c78e6SLoic Poulain        led-controller@62 {
200*160c78e6SLoic Poulain            compatible = "nxp,pca9633";
201*160c78e6SLoic Poulain            reg = <0x62>;
202*160c78e6SLoic Poulain            #address-cells = <1>;
203*160c78e6SLoic Poulain            #size-cells = <0>;
204*160c78e6SLoic Poulain
205*160c78e6SLoic Poulain            /* Three channels controlling one RGB LED */
206*160c78e6SLoic Poulain            multi-led@0 {
207*160c78e6SLoic Poulain                reg = <0>;
208*160c78e6SLoic Poulain                color = <LED_COLOR_ID_RGB>;
209*160c78e6SLoic Poulain                function = LED_FUNCTION_STATUS;
210*160c78e6SLoic Poulain                #address-cells = <1>;
211*160c78e6SLoic Poulain                #size-cells = <0>;
212*160c78e6SLoic Poulain
213*160c78e6SLoic Poulain                led@0 {
214*160c78e6SLoic Poulain                    reg = <0>;
215*160c78e6SLoic Poulain                    color = <LED_COLOR_ID_RED>;
216*160c78e6SLoic Poulain                };
217*160c78e6SLoic Poulain
218*160c78e6SLoic Poulain                led@1 {
219*160c78e6SLoic Poulain                    reg = <1>;
220*160c78e6SLoic Poulain                    color = <LED_COLOR_ID_GREEN>;
221*160c78e6SLoic Poulain                };
222*160c78e6SLoic Poulain
223*160c78e6SLoic Poulain                led@2 {
224*160c78e6SLoic Poulain                    reg = <2>;
225*160c78e6SLoic Poulain                    color = <LED_COLOR_ID_BLUE>;
226*160c78e6SLoic Poulain                };
227*160c78e6SLoic Poulain            };
228*160c78e6SLoic Poulain
229*160c78e6SLoic Poulain            /* Remaining channel used as a plain white LED */
230*160c78e6SLoic Poulain            led@3 {
231*160c78e6SLoic Poulain                reg = <3>;
232*160c78e6SLoic Poulain                color = <LED_COLOR_ID_WHITE>;
233*160c78e6SLoic Poulain                function = LED_FUNCTION_STATUS;
234*160c78e6SLoic Poulain            };
235*160c78e6SLoic Poulain        };
236*160c78e6SLoic Poulain    };
237*160c78e6SLoic Poulain
238a004f242SLaurent Pinchart...
239