Linux 6.7-rc7
[linux-modified.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,tca9538
70               - ti,tca9539
71               - ti,tca9554
72
73   reg:
74     maxItems: 1
75
76   gpio-controller: true
77
78   '#gpio-cells':
79     const: 2
80
81   gpio-line-names:
82     minItems: 1
83     maxItems: 40
84
85   interrupts:
86     maxItems: 1
87
88   interrupt-controller: true
89
90   '#interrupt-cells':
91     const: 2
92
93   reset-gpios:
94     maxItems: 1
95     description:
96       GPIO specification for the RESET input. This is an active low signal to
97       the PCA953x.  Not valid for Maxim MAX732x devices.
98
99   vcc-supply:
100     description:
101       Optional power supply.  Not valid for Maxim MAX732x devices.
102
103   wakeup-source:
104     $ref: /schemas/types.yaml#/definitions/flag
105
106 patternProperties:
107   "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
108     type: object
109     properties:
110       gpio-hog: true
111       gpios: true
112       input: true
113       output-high: true
114       output-low: true
115       line-name: true
116
117     required:
118       - gpio-hog
119       - gpios
120
121     additionalProperties: false
122
123 required:
124   - compatible
125   - reg
126   - gpio-controller
127   - "#gpio-cells"
128
129 additionalProperties: false
130
131 allOf:
132   - if:
133       properties:
134         compatible:
135           contains:
136             enum:
137               - maxim,max7320
138               - maxim,max7321
139               - maxim,max7322
140               - maxim,max7323
141               - maxim,max7324
142               - maxim,max7325
143               - maxim,max7326
144               - maxim,max7327
145     then:
146       properties:
147         reset-gpios: false
148         vcc-supply: false
149
150 examples:
151   - |
152     #include <dt-bindings/gpio/gpio.h>
153     #include <dt-bindings/interrupt-controller/irq.h>
154
155     i2c {
156         #address-cells = <1>;
157         #size-cells = <0>;
158
159         gpio@20 {
160             compatible = "nxp,pca9505";
161             reg = <0x20>;
162             pinctrl-names = "default";
163             pinctrl-0 = <&pinctrl_pca9505>;
164             gpio-controller;
165             #gpio-cells = <2>;
166             interrupt-parent = <&gpio3>;
167             interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
168
169             usb3-sata-sel-hog {
170                 gpio-hog;
171                 gpios = <4 GPIO_ACTIVE_HIGH>;
172                 output-low;
173                 line-name = "usb3_sata_sel";
174             };
175         };
176     };
177
178   - |
179     #include <dt-bindings/interrupt-controller/irq.h>
180
181     i2c {
182         #address-cells = <1>;
183         #size-cells = <0>;
184
185         gpio99: gpio@22 {
186             compatible = "nxp,pcal6524";
187             reg = <0x22>;
188             interrupt-parent = <&gpio6>;
189             interrupts = <1 IRQ_TYPE_EDGE_FALLING>; /* gpio6_161 */
190             interrupt-controller;
191             #interrupt-cells = <2>;
192             vcc-supply = <&vdds_1v8_main>;
193             gpio-controller;
194             #gpio-cells = <2>;
195             gpio-line-names = "hdmi-ct-hpd", "hdmi.ls-oe", "p02", "p03",
196                               "vibra", "fault2", "p06", "p07", "en-usb",
197                               "en-host1", "en-host2", "chg-int", "p14", "p15",
198                               "mic-int", "en-modem", "shdn-hs-amp",
199                               "chg-status+red", "green", "blue", "en-esata",
200                               "fault1", "p26", "p27";
201         };
202     };
203
204   - |
205     #include <dt-bindings/interrupt-controller/irq.h>
206
207     i2c {
208         #address-cells = <1>;
209         #size-cells = <0>;
210
211         /* MAX7325 with interrupt support enabled */
212         gpio@6d {
213             compatible = "maxim,max7325";
214             reg = <0x6d>;
215             gpio-controller;
216             #gpio-cells = <2>;
217             interrupt-controller;
218             #interrupt-cells = <2>;
219             interrupt-parent = <&gpio4>;
220             interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
221         };
222     };
223
224   - |
225     i2c {
226         #address-cells = <1>;
227         #size-cells = <0>;
228
229         /* MAX7325 with interrupt support disabled */
230         gpio@6e {
231             compatible = "maxim,max7325";
232             reg = <0x6e>;
233             gpio-controller;
234             #gpio-cells = <2>;
235         };
236     };