xref: /freebsd/sys/contrib/device-tree/Bindings/leds/nxp,pca963x.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1*7d0873ebSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*7d0873ebSEmmanuel Vadot%YAML 1.2
3*7d0873ebSEmmanuel Vadot---
4*7d0873ebSEmmanuel Vadot$id: http://devicetree.org/schemas/leds/nxp,pca963x.yaml#
5*7d0873ebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*7d0873ebSEmmanuel Vadot
7*7d0873ebSEmmanuel Vadottitle: NXP PCA963x LED controllers
8*7d0873ebSEmmanuel Vadot
9*7d0873ebSEmmanuel Vadotmaintainers:
10*7d0873ebSEmmanuel Vadot  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
11*7d0873ebSEmmanuel Vadot
12*7d0873ebSEmmanuel Vadotdescription: |
13*7d0873ebSEmmanuel Vadot  The NXP PCA963x are I2C-controlled LED drivers optimized for
14*7d0873ebSEmmanuel Vadot  Red/Green/Blue/Amber (RGBA) color mixing applications. Each LED is
15*7d0873ebSEmmanuel Vadot  individually controllable and has its own PWM controller.
16*7d0873ebSEmmanuel Vadot
17*7d0873ebSEmmanuel Vadot  Datasheets are available at
18*7d0873ebSEmmanuel Vadot
19*7d0873ebSEmmanuel Vadot  - https://www.nxp.com/docs/en/data-sheet/PCA9632.pdf
20*7d0873ebSEmmanuel Vadot  - https://www.nxp.com/docs/en/data-sheet/PCA9633.pdf
21*7d0873ebSEmmanuel Vadot  - https://www.nxp.com/docs/en/data-sheet/PCA9634.pdf
22*7d0873ebSEmmanuel Vadot  - https://www.nxp.com/docs/en/data-sheet/PCA9635.pdf
23*7d0873ebSEmmanuel Vadot
24*7d0873ebSEmmanuel Vadotproperties:
25*7d0873ebSEmmanuel Vadot  compatible:
26*7d0873ebSEmmanuel Vadot    enum:
27*7d0873ebSEmmanuel Vadot      - nxp,pca9632
28*7d0873ebSEmmanuel Vadot      - nxp,pca9633
29*7d0873ebSEmmanuel Vadot      - nxp,pca9634
30*7d0873ebSEmmanuel Vadot      - nxp,pca9635
31*7d0873ebSEmmanuel Vadot
32*7d0873ebSEmmanuel Vadot  reg:
33*7d0873ebSEmmanuel Vadot    maxItems: 1
34*7d0873ebSEmmanuel Vadot
35*7d0873ebSEmmanuel Vadot  "#address-cells":
36*7d0873ebSEmmanuel Vadot    const: 1
37*7d0873ebSEmmanuel Vadot
38*7d0873ebSEmmanuel Vadot  "#size-cells":
39*7d0873ebSEmmanuel Vadot    const: 0
40*7d0873ebSEmmanuel Vadot
41*7d0873ebSEmmanuel Vadot  nxp,hw-blink:
42*7d0873ebSEmmanuel Vadot    type: boolean
43*7d0873ebSEmmanuel Vadot    description:
44*7d0873ebSEmmanuel Vadot      Use hardware blinking instead of software blinking
45*7d0873ebSEmmanuel Vadot
46*7d0873ebSEmmanuel Vadot  nxp,inverted-out:
47*7d0873ebSEmmanuel Vadot    type: boolean
48*7d0873ebSEmmanuel Vadot    description:
49*7d0873ebSEmmanuel Vadot      Invert the polarity of the generated PWM.
50*7d0873ebSEmmanuel Vadot
51*7d0873ebSEmmanuel Vadot  nxp,period-scale:
52*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
53*7d0873ebSEmmanuel Vadot    description:
54*7d0873ebSEmmanuel Vadot      In some configurations, the chip blinks faster than expected. This
55*7d0873ebSEmmanuel Vadot      parameter provides a scaling ratio (fixed point, decimal divided by 1000)
56*7d0873ebSEmmanuel Vadot      to compensate, e.g. 1300=1.3x and 750=0.75x.
57*7d0873ebSEmmanuel Vadot
58*7d0873ebSEmmanuel Vadot  nxp,totem-pole:
59*7d0873ebSEmmanuel Vadot    type: boolean
60*7d0873ebSEmmanuel Vadot    description:
61*7d0873ebSEmmanuel Vadot      Use totem pole (push-pull) instead of open-drain (pca9632 defaults to
62*7d0873ebSEmmanuel Vadot      open-drain, newer chips to totem pole).
63*7d0873ebSEmmanuel Vadot
64*7d0873ebSEmmanuel VadotpatternProperties:
65*7d0873ebSEmmanuel Vadot  "^led@[0-9a-f]+$":
66*7d0873ebSEmmanuel Vadot    type: object
67*7d0873ebSEmmanuel Vadot    $ref: common.yaml#
68*7d0873ebSEmmanuel Vadot    unevaluatedProperties: false
69*7d0873ebSEmmanuel Vadot
70*7d0873ebSEmmanuel Vadot    properties:
71*7d0873ebSEmmanuel Vadot      reg:
72*7d0873ebSEmmanuel Vadot        minimum: 0
73*7d0873ebSEmmanuel Vadot
74*7d0873ebSEmmanuel Vadot    required:
75*7d0873ebSEmmanuel Vadot      - reg
76*7d0873ebSEmmanuel Vadot
77*7d0873ebSEmmanuel VadotallOf:
78*7d0873ebSEmmanuel Vadot  - if:
79*7d0873ebSEmmanuel Vadot      properties:
80*7d0873ebSEmmanuel Vadot        compatible:
81*7d0873ebSEmmanuel Vadot          contains:
82*7d0873ebSEmmanuel Vadot            enum:
83*7d0873ebSEmmanuel Vadot              - nxp,pca9632
84*7d0873ebSEmmanuel Vadot              - nxp,pca9633
85*7d0873ebSEmmanuel Vadot    then:
86*7d0873ebSEmmanuel Vadot      patternProperties:
87*7d0873ebSEmmanuel Vadot        "^led@[0-9a-f]+$":
88*7d0873ebSEmmanuel Vadot          properties:
89*7d0873ebSEmmanuel Vadot            reg:
90*7d0873ebSEmmanuel Vadot              maximum: 3
91*7d0873ebSEmmanuel Vadot    else:
92*7d0873ebSEmmanuel Vadot      patternProperties:
93*7d0873ebSEmmanuel Vadot        "^led@[0-9a-f]+$":
94*7d0873ebSEmmanuel Vadot          properties:
95*7d0873ebSEmmanuel Vadot            reg:
96*7d0873ebSEmmanuel Vadot              maximum: 7
97*7d0873ebSEmmanuel Vadot
98*7d0873ebSEmmanuel VadotadditionalProperties: false
99*7d0873ebSEmmanuel Vadot
100*7d0873ebSEmmanuel Vadotexamples:
101*7d0873ebSEmmanuel Vadot  - |
102*7d0873ebSEmmanuel Vadot    #include <dt-bindings/leds/common.h>
103*7d0873ebSEmmanuel Vadot
104*7d0873ebSEmmanuel Vadot    i2c {
105*7d0873ebSEmmanuel Vadot        #address-cells = <1>;
106*7d0873ebSEmmanuel Vadot        #size-cells = <0>;
107*7d0873ebSEmmanuel Vadot
108*7d0873ebSEmmanuel Vadot        led-controller@62 {
109*7d0873ebSEmmanuel Vadot            compatible = "nxp,pca9632";
110*7d0873ebSEmmanuel Vadot            reg = <0x62>;
111*7d0873ebSEmmanuel Vadot            #address-cells = <1>;
112*7d0873ebSEmmanuel Vadot            #size-cells = <0>;
113*7d0873ebSEmmanuel Vadot
114*7d0873ebSEmmanuel Vadot            led@0 {
115*7d0873ebSEmmanuel Vadot                    reg = <0>;
116*7d0873ebSEmmanuel Vadot                    color = <LED_COLOR_ID_RED>;
117*7d0873ebSEmmanuel Vadot                    function = LED_FUNCTION_STATUS;
118*7d0873ebSEmmanuel Vadot            };
119*7d0873ebSEmmanuel Vadot
120*7d0873ebSEmmanuel Vadot            led@1 {
121*7d0873ebSEmmanuel Vadot                    reg = <1>;
122*7d0873ebSEmmanuel Vadot                    color = <LED_COLOR_ID_GREEN>;
123*7d0873ebSEmmanuel Vadot                    function = LED_FUNCTION_STATUS;
124*7d0873ebSEmmanuel Vadot            };
125*7d0873ebSEmmanuel Vadot
126*7d0873ebSEmmanuel Vadot            led@2 {
127*7d0873ebSEmmanuel Vadot                    reg = <2>;
128*7d0873ebSEmmanuel Vadot                    color = <LED_COLOR_ID_BLUE>;
129*7d0873ebSEmmanuel Vadot                    function = LED_FUNCTION_STATUS;
130*7d0873ebSEmmanuel Vadot            };
131*7d0873ebSEmmanuel Vadot
132*7d0873ebSEmmanuel Vadot            led@3 {
133*7d0873ebSEmmanuel Vadot                    reg = <3>;
134*7d0873ebSEmmanuel Vadot                    color = <LED_COLOR_ID_WHITE>;
135*7d0873ebSEmmanuel Vadot                    function = LED_FUNCTION_STATUS;
136*7d0873ebSEmmanuel Vadot            };
137*7d0873ebSEmmanuel Vadot        };
138*7d0873ebSEmmanuel Vadot    };
139*7d0873ebSEmmanuel Vadot
140*7d0873ebSEmmanuel Vadot...
141