xref: /freebsd/sys/contrib/device-tree/Bindings/leds/issi,is31fl319x.yaml (revision 1b10e191f341111fad7be32ead11484dfd09b800)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/issi,is31fl319x.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ISSI LED controllers bindings for IS31FL319{0,1,3,6,9}
8
9maintainers:
10  - Vincent Knecht <vincent.knecht@mailoo.org>
11
12description: |
13  The IS31FL319X are LED controllers with I2C interface.
14  Previously known as Si-En SN319{0,1,3,6,9}.
15
16  For more product information please see the links below:
17    https://lumissil.com/assets/pdf/core/IS31FL3190_DS.pdf
18    https://lumissil.com/assets/pdf/core/IS31FL3191_DS.pdf
19    https://lumissil.com/assets/pdf/core/IS31FL3193_DS.pdf
20    https://lumissil.com/assets/pdf/core/IS31FL3196_DS.pdf
21    https://lumissil.com/assets/pdf/core/IS31FL3199_DS.pdf
22
23properties:
24  compatible:
25    enum:
26      - issi,is31fl3190
27      - issi,is31fl3191
28      - issi,is31fl3193
29      - issi,is31fl3196
30      - issi,is31fl3199
31      - si-en,sn3190
32      - si-en,sn3191
33      - si-en,sn3193
34      - si-en,sn3196
35      - si-en,sn3199
36
37  reg:
38    maxItems: 1
39
40  shutdown-gpios:
41    maxItems: 1
42    description: GPIO attached to the SDB pin.
43
44  audio-gain-db:
45    $ref: /schemas/types.yaml#/definitions/uint32
46    default: 0
47    description: Audio gain selection for external analog modulation input.
48    enum: [0, 3, 6, 9, 12, 15, 18, 21]
49
50  "#address-cells":
51    const: 1
52
53  "#size-cells":
54    const: 0
55
56patternProperties:
57  "^led@[1-9]$":
58    type: object
59    $ref: common.yaml#
60
61    properties:
62      reg:
63        description: Index of the LED.
64        minimum: 1
65        maximum: 9
66
67      led-max-microamp:
68        description:
69          Note that a driver will take the lowest of all LED limits
70          since the chip has a single global setting. The lowest value
71          will be chosen due to the PWM specificity, where lower
72          brightness is achieved by reducing the duty-cycle of pulses
73          and not the current, which will always have its peak value
74          equal to led-max-microamp.
75
76allOf:
77  - if:
78      properties:
79        compatible:
80          contains:
81            enum:
82              - issi,is31fl3190
83              - issi,is31fl3191
84              - issi,is31fl3193
85              - si-en,sn3190
86              - si-en,sn3191
87              - si-en,sn3193
88    then:
89      properties:
90        reg:
91          enum: [0x68, 0x69, 0x6a, 0x6b]
92
93        audio-gain-db: false
94
95      patternProperties:
96        "^led@[1-9]$":
97          properties:
98            led-max-microamp:
99              default: 42000
100              enum: [5000, 10000, 17500, 30000, 42000]
101    else:
102      properties:
103        reg:
104          enum: [0x64, 0x65, 0x66, 0x67]
105
106      patternProperties:
107        "^led@[1-9]$":
108          properties:
109            led-max-microamp:
110              default: 20000
111              enum: [5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000]
112  - if:
113      properties:
114        compatible:
115          contains:
116            enum:
117              - issi,is31fl3190
118              - issi,is31fl3191
119              - si-en,sn3190
120              - si-en,sn3191
121    then:
122      patternProperties:
123        "^led@[1-9]$":
124          properties:
125            reg:
126              maximum: 1
127  - if:
128      properties:
129        compatible:
130          contains:
131            enum:
132              - issi,is31fl3193
133              - si-en,sn3193
134    then:
135      patternProperties:
136        "^led@[1-9]$":
137          properties:
138            reg:
139              maximum: 3
140  - if:
141      properties:
142        compatible:
143          contains:
144            enum:
145              - issi,is31fl3196
146              - si-en,sn3196
147    then:
148      patternProperties:
149        "^led@[1-9]$":
150          properties:
151            reg:
152              maximum: 6
153
154required:
155  - compatible
156  - reg
157  - "#address-cells"
158  - "#size-cells"
159
160additionalProperties: false
161
162examples:
163  - |
164    #include <dt-bindings/gpio/gpio.h>
165    #include <dt-bindings/leds/common.h>
166
167    i2c0 {
168        #address-cells = <1>;
169        #size-cells = <0>;
170
171        led-controller@65 {
172            compatible = "issi,is31fl3196";
173            reg = <0x65>;
174            #address-cells = <1>;
175            #size-cells = <0>;
176
177            shutdown-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
178
179            led@1 {
180                reg = <1>;
181                label = "red:aux";
182                led-max-microamp = <10000>;
183            };
184
185            led@5 {
186                reg = <5>;
187                label = "green:power";
188                linux,default-trigger = "default-on";
189            };
190        };
191    };
192...
193
194