GNU Linux-libre 6.1.90-gnu
[releases.git] / Documentation / devicetree / bindings / gpio / gpio-pca95xx.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/gpio/gpio-pca95xx.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: NXP PCA95xx I2C GPIO multiplexer
8
9 maintainers:
10   - Krzysztof Kozlowski <krzk@kernel.org>
11
12 description: |+
13   Bindings for the family of I2C GPIO multiplexers/expanders: NXP PCA95xx,
14   Maxim MAX73xx
15
16 properties:
17   compatible:
18     oneOf:
19       - items:
20           - const: diodes,pi4ioe5v6534q
21           - const: nxp,pcal6534
22       - items:
23           - enum:
24               - exar,xra1202
25               - maxim,max7310
26               - maxim,max7312
27               - maxim,max7313
28               - maxim,max7315
29               - maxim,max7319
30               - maxim,max7320
31               - maxim,max7321
32               - maxim,max7322
33               - maxim,max7323
34               - maxim,max7324
35               - maxim,max7325
36               - maxim,max7326
37               - maxim,max7327
38               - nxp,pca6408
39               - nxp,pca6416
40               - nxp,pca9505
41               - nxp,pca9506
42               - nxp,pca9534
43               - nxp,pca9535
44               - nxp,pca9536
45               - nxp,pca9537
46               - nxp,pca9538
47               - nxp,pca9539
48               - nxp,pca9554
49               - nxp,pca9555
50               - nxp,pca9556
51               - nxp,pca9557
52               - nxp,pca9574
53               - nxp,pca9575
54               - nxp,pca9698
55               - nxp,pcal6408
56               - nxp,pcal6416
57               - nxp,pcal6524
58               - nxp,pcal6534
59               - nxp,pcal9535
60               - nxp,pcal9554b
61               - nxp,pcal9555a
62               - onnn,cat9554
63               - onnn,pca9654
64               - ti,pca6107
65               - ti,pca9536
66               - ti,tca6408
67               - ti,tca6416
68               - ti,tca6424
69               - ti,tca9539
70               - ti,tca9554
71
72   reg:
73     maxItems: 1
74
75   gpio-controller: true
76
77   '#gpio-cells':
78     const: 2
79
80   gpio-line-names:
81     minItems: 1
82     maxItems: 40
83
84   interrupts:
85     maxItems: 1
86
87   interrupt-controller: true
88
89   '#interrupt-cells':
90     const: 2
91
92   reset-gpios:
93     maxItems: 1
94     description:
95       GPIO specification for the RESET input. This is an active low signal to
96       the PCA953x.  Not valid for Maxim MAX732x devices.
97
98   vcc-supply:
99     description:
100       Optional power supply.  Not valid for Maxim MAX732x devices.
101
102   wakeup-source:
103     $ref: /schemas/types.yaml#/definitions/flag
104
105 patternProperties:
106   "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
107     type: object
108     properties:
109       gpio-hog: true
110       gpios: true
111       input: true
112       output-high: true
113       output-low: true
114       line-name: true
115
116     required:
117       - gpio-hog
118       - gpios
119
120     additionalProperties: false
121
122 required:
123   - compatible
124   - reg
125   - gpio-controller
126   - "#gpio-cells"
127
128 additionalProperties: false
129
130 allOf:
131   - if:
132       properties:
133         compatible:
134           contains:
135             enum:
136               - maxim,max7320
137               - maxim,max7321
138               - maxim,max7322
139               - maxim,max7323
140               - maxim,max7324
141               - maxim,max7325
142               - maxim,max7326
143               - maxim,max7327
144     then:
145       properties:
146         reset-gpios: false
147         vcc-supply: false
148
149 examples:
150   - |
151     #include <dt-bindings/gpio/gpio.h>
152     #include <dt-bindings/interrupt-controller/irq.h>
153
154     i2c0 {
155         #address-cells = <1>;
156         #size-cells = <0>;
157
158         gpio@20 {
159             compatible = "nxp,pca9505";
160             reg = <0x20>;
161             pinctrl-names = "default";
162             pinctrl-0 = <&pinctrl_pca9505>;
163             gpio-controller;
164             #gpio-cells = <2>;
165             interrupt-parent = <&gpio3>;
166             interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
167
168             usb3-sata-sel-hog {
169                 gpio-hog;
170                 gpios = <4 GPIO_ACTIVE_HIGH>;
171                 output-low;
172                 line-name = "usb3_sata_sel";
173             };
174         };
175     };
176
177   - |
178     #include <dt-bindings/interrupt-controller/irq.h>
179
180     i2c1 {
181         #address-cells = <1>;
182         #size-cells = <0>;
183
184         gpio99: gpio@22 {
185             compatible = "nxp,pcal6524";
186             reg = <0x22>;
187             interrupt-parent = <&gpio6>;
188             interrupts = <1 IRQ_TYPE_EDGE_FALLING>; /* gpio6_161 */
189             interrupt-controller;
190             #interrupt-cells = <2>;
191             vcc-supply = <&vdds_1v8_main>;
192             gpio-controller;
193             #gpio-cells = <2>;
194             gpio-line-names = "hdmi-ct-hpd", "hdmi.ls-oe", "p02", "p03",
195                               "vibra", "fault2", "p06", "p07", "en-usb",
196                               "en-host1", "en-host2", "chg-int", "p14", "p15",
197                               "mic-int", "en-modem", "shdn-hs-amp",
198                               "chg-status+red", "green", "blue", "en-esata",
199                               "fault1", "p26", "p27";
200         };
201     };
202
203   - |
204     #include <dt-bindings/interrupt-controller/irq.h>
205
206     i2c2 {
207         #address-cells = <1>;
208         #size-cells = <0>;
209
210         /* MAX7325 with interrupt support enabled */
211         gpio@6d {
212             compatible = "maxim,max7325";
213             reg = <0x6d>;
214             gpio-controller;
215             #gpio-cells = <2>;
216             interrupt-controller;
217             #interrupt-cells = <2>;
218             interrupt-parent = <&gpio4>;
219             interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
220         };
221     };
222
223   - |
224     i2c3 {
225         #address-cells = <1>;
226         #size-cells = <0>;
227
228         /* MAX7325 with interrupt support disabled */
229         gpio@6e {
230             compatible = "maxim,max7325";
231             reg = <0x6e>;
232             gpio-controller;
233             #gpio-cells = <2>;
234         };
235     };