xref: /linux/Documentation/devicetree/bindings/pinctrl/airoha,an7563-pinctrl.yaml (revision cf9610f9116d55c5a66ef9f1faecacabd93a9322)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/airoha,an7563-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Airoha AN7563 Pin Controller
8
9maintainers:
10  - Lorenzo Bianconi <lorenzo@kernel.org>
11
12description:
13  The Airoha's AN7563 Pin controller is used to control SoC pins.
14
15properties:
16  compatible:
17    const: airoha,an7563-pinctrl
18
19  interrupts:
20    maxItems: 1
21
22  gpio-controller: true
23
24  '#gpio-cells':
25    const: 2
26
27  gpio-ranges:
28    maxItems: 1
29
30  interrupt-controller: true
31
32  '#interrupt-cells':
33    const: 2
34
35allOf:
36  - $ref: pinctrl.yaml#
37
38required:
39  - compatible
40  - interrupts
41  - gpio-controller
42  - "#gpio-cells"
43  - interrupt-controller
44  - "#interrupt-cells"
45
46patternProperties:
47  '-pins$':
48    type: object
49
50    patternProperties:
51      '^mux(-|$)':
52        type: object
53
54        description:
55          pinmux configuration nodes.
56
57        $ref: /schemas/pinctrl/pinmux-node.yaml
58
59        properties:
60          function:
61            description:
62              A string containing the name of the function to mux to the group.
63            enum: [pon, sipo, mdio, uart, jtag, pcm, spi, pnand, gpio,
64                   pcie_reset, pwm, phy1_led0, phy2_led0, phy3_led0,
65                   phy4_led0, phy1_led1, phy2_led1, phy3_led1, phy4_led1]
66
67          groups:
68            description:
69              An array of strings. Each string contains the name of a group.
70
71        required:
72          - function
73          - groups
74
75        allOf:
76          - if:
77              properties:
78                function:
79                  const: pon
80            then:
81              properties:
82                groups:
83                  enum: [pon]
84          - if:
85              properties:
86                function:
87                  const: sipo
88            then:
89              properties:
90                groups:
91                  enum: [sipo, sipo_rclk]
92          - if:
93              properties:
94                function:
95                  const: mdio
96            then:
97              properties:
98                groups:
99                  enum: [mdio]
100          - if:
101              properties:
102                function:
103                  const: uart
104            then:
105              properties:
106                groups:
107                  items:
108                    enum: [hsuart, hsuart_cts_rts]
109                  maxItems: 2
110          - if:
111              properties:
112                function:
113                  const: jtag
114            then:
115              properties:
116                groups:
117                  enum: [jtag_udi, jtag_dfd]
118          - if:
119              properties:
120                function:
121                  const: pcm
122            then:
123              properties:
124                groups:
125                  enum: [pcm1, pcm2]
126          - if:
127              properties:
128                function:
129                  const: spi
130            then:
131              properties:
132                groups:
133                  items:
134                    enum: [spi_quad, spi_cs1]
135                  maxItems: 2
136          - if:
137              properties:
138                function:
139                  const: pnand
140            then:
141              properties:
142                groups:
143                  enum: [pnand]
144          - if:
145              properties:
146                function:
147                  const: gpio
148            then:
149              properties:
150                groups:
151                  enum: [gpio28, gpio29, gpio30, gpio31, gpio32,
152                         gpio33, gpio34, gpio35, gpio36, gpio37]
153          - if:
154              properties:
155                function:
156                  const: pcie_reset
157            then:
158              properties:
159                groups:
160                  enum: [pcie_reset0, pcie_reset1]
161          - if:
162              properties:
163                function:
164                  const: pwm
165            then:
166              properties:
167                groups:
168                  enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6,
169                         gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, gpio13,
170                         gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
171                         gpio20, gpio21, gpio22, gpio23, gpio24, gpio25,
172                         gpio26, gpio27, gpio28, gpio29, gpio30, gpio31,
173                         gpio36, gpio37]
174          - if:
175              properties:
176                function:
177                  const: phy1_led0
178            then:
179              properties:
180                groups:
181                  enum: [gpio8, gpio9, gpio10, gpio11]
182          - if:
183              properties:
184                function:
185                  const: phy2_led0
186            then:
187              properties:
188                groups:
189                  enum: [gpio8, gpio9, gpio10, gpio11]
190          - if:
191              properties:
192                function:
193                  const: phy3_led0
194            then:
195              properties:
196                groups:
197                  enum: [gpio8, gpio9, gpio10, gpio11]
198          - if:
199              properties:
200                function:
201                  const: phy4_led0
202            then:
203              properties:
204                groups:
205                  enum: [gpio8, gpio9, gpio10, gpio11]
206          - if:
207              properties:
208                function:
209                  const: phy1_led1
210            then:
211              properties:
212                groups:
213                  enum: [gpio4, gpio5, gpio6, gpio7]
214          - if:
215              properties:
216                function:
217                  const: phy2_led1
218            then:
219              properties:
220                groups:
221                  enum: [gpio4, gpio5, gpio6, gpio7]
222          - if:
223              properties:
224                function:
225                  const: phy3_led1
226            then:
227              properties:
228                groups:
229                  enum: [gpio4, gpio5, gpio6, gpio7]
230          - if:
231              properties:
232                function:
233                  const: phy4_led1
234            then:
235              properties:
236                groups:
237                  enum: [gpio4, gpio5, gpio6, gpio7]
238
239        additionalProperties: false
240
241      '^conf(-|$)':
242        type: object
243
244        description:
245          pinconf configuration nodes.
246
247        $ref: /schemas/pinctrl/pincfg-node.yaml
248
249        properties:
250          pins:
251            description:
252              An array of strings. Each string contains the name of a pin.
253            items:
254              enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7,
255                     gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio14,
256                     gpio15, gpio16, gpio17, gpio18, gpio19, gpio20, gpio21,
257                     gpio22, gpio23, gpio24, gpio25, gpio26, gpio27,
258                     pcie_reset0, pcie_reset1, i2c_scl, i2c_sda, spi_clk,
259                     spi_cs, spi_mosi, spi_miso, uart_txd, uart_rxd]
260            minItems: 1
261            maxItems: 38
262
263          bias-disable: true
264
265          bias-pull-up: true
266
267          bias-pull-down: true
268
269          input-enable: true
270
271          output-enable: true
272
273          output-low: true
274
275          output-high: true
276
277          drive-open-drain: true
278
279          drive-strength:
280            description:
281              Selects the drive strength for MIO pins, in mA.
282            enum: [2, 4, 6, 8]
283
284        required:
285          - pins
286
287        additionalProperties: false
288
289    additionalProperties: false
290
291additionalProperties: false
292
293examples:
294  - |
295    #include <dt-bindings/interrupt-controller/arm-gic.h>
296
297    pinctrl {
298      compatible = "airoha,an7563-pinctrl";
299
300      interrupt-parent = <&gic>;
301      interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
302
303      gpio-controller;
304      #gpio-cells = <2>;
305
306      interrupt-controller;
307      #interrupt-cells = <2>;
308
309      gpio-ranges = <&pinctrl 0 0 38>;
310
311      pcie1-rst-pins {
312        conf {
313          pins = "pcie_reset1";
314          drive-open-drain = <1>;
315        };
316      };
317
318      pwm-pins {
319        mux {
320          function = "pwm";
321          groups = "gpio18";
322        };
323      };
324
325      spi-pins {
326        mux {
327          function = "spi";
328          groups = "spi_quad", "spi_cs1";
329        };
330      };
331
332      hsuart-pins {
333        mux {
334          function = "uart";
335          groups = "hsuart", "hsuart_cts_rts";
336        };
337      };
338
339      mdio-pins {
340        mux {
341          function = "mdio";
342          groups = "mdio";
343        };
344
345        conf {
346          pins = "gpio2";
347          output-enable;
348        };
349      };
350    };
351