09ebb8ac22ace5da4e0b26ee38c77567e748fba0
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / pinctrl / ralink,mt7620-pinctrl.yaml
1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/pinctrl/ralink,mt7620-pinctrl.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Ralink MT7620 Pin Controller
8
9 maintainers:
10   - Arınç ÜNAL <arinc.unal@arinc9.com>
11   - Sergio Paracuellos <sergio.paracuellos@gmail.com>
12
13 description:
14   Ralink MT7620 pin controller for MT7620, MT7628 and MT7688 SoCs.
15   The pin controller can only set the muxing of pin groups. Muxing individual
16   pins is not supported. There is no pinconf support.
17
18 properties:
19   compatible:
20     enum:
21       - ralink,mt7620-pinctrl
22       - ralink,mt76x8-pinctrl
23
24 patternProperties:
25   '-pins$':
26     type: object
27     additionalProperties: false
28
29     patternProperties:
30       '^(.*-)?pinmux$':
31         type: object
32         description: node for pinctrl.
33         $ref: pinmux-node.yaml#
34         additionalProperties: false
35
36         properties:
37           function:
38             description:
39               A string containing the name of the function to mux to the group.
40             anyOf:
41               - description: For MT7620 SoC
42                 enum: [ephy, gpio, gpio i2s, gpio uartf, i2c, i2s uartf, mdio, nand, pa,
43                        pcie refclk, pcie rst, pcm gpio, pcm i2s, pcm uartf, refclk,
44                        rgmii1, rgmii2, sd, spi, spi refclk, uartf, uartlite, wdt refclk,
45                        wdt rst, wled]
46
47               - description: For MT7628 and MT7688 SoCs
48                 enum: [antenna, debug, gpio, i2c, i2s, jtag, p0led_an, p0led_kn,
49                        p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn,
50                        p4led_an, p4led_kn, pcie, pcm, perst, pwm, pwm0, pwm1, pwm_uart2,
51                        refclk, rsvd, sdxc, sdxc d5 d4, sdxc d6, sdxc d7, spi, spi cs1,
52                        spis, sw_r, uart0, uart1, uart2, utif, wdt, wled_an, wled_kn, -]
53
54           groups:
55             description:
56               An array of strings. Each string contains the name of a group.
57             maxItems: 1
58
59         required:
60           - groups
61           - function
62
63         allOf:
64           - if:
65               properties:
66                 function:
67                   const: antenna
68             then:
69               properties:
70                 groups:
71                   enum: [i2s]
72
73           - if:
74               properties:
75                 function:
76                   const: debug
77             then:
78               properties:
79                 groups:
80                   enum: [i2c]
81
82           - if:
83               properties:
84                 function:
85                   const: ephy
86             then:
87               properties:
88                 groups:
89                   enum: [ephy]
90
91           - if:
92               properties:
93                 function:
94                   const: gpio
95             then:
96               properties:
97                 groups:
98                   anyOf:
99                     - description: For MT7620 SoC
100                       enum: [ephy, i2c, mdio, nd_sd, pa, pcie, rgmii1, rgmii2,
101                              spi, spi refclk, uartf, uartlite, wdt, wled]
102
103                     - description: For MT7628 and MT7688 SoCs
104                       enum: [gpio, i2c, i2s, p0led_an, p0led_kn, p1led_an,
105                              p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn,
106                              p4led_an, p4led_kn, perst, pwm0, pwm1, refclk,
107                              sdmode, spi, spi cs1, spis, uart0, uart1, uart2,
108                              wdt, wled_an, wled_kn]
109
110           - if:
111               properties:
112                 function:
113                   const: gpio i2s
114             then:
115               properties:
116                 groups:
117                   enum: [uartf]
118
119           - if:
120               properties:
121                 function:
122                   const: gpio uartf
123             then:
124               properties:
125                 groups:
126                   enum: [uartf]
127
128           - if:
129               properties:
130                 function:
131                   const: i2c
132             then:
133               properties:
134                 groups:
135                   enum: [i2c]
136
137           - if:
138               properties:
139                 function:
140                   const: i2s
141             then:
142               properties:
143                 groups:
144                   enum: [i2s]
145
146           - if:
147               properties:
148                 function:
149                   const: i2s uartf
150             then:
151               properties:
152                 groups:
153                   enum: [uartf]
154
155           - if:
156               properties:
157                 function:
158                   const: jtag
159             then:
160               properties:
161                 groups:
162                   enum: [p0led_an, p0led_kn, p1led_an, p1led_kn, p2led_an,
163                          p2led_kn, p3led_an, p3led_kn, p4led_an, p4led_kn,
164                          sdmode]
165
166           - if:
167               properties:
168                 function:
169                   const: mdio
170             then:
171               properties:
172                 groups:
173                   enum: [mdio]
174
175           - if:
176               properties:
177                 function:
178                   const: nand
179             then:
180               properties:
181                 groups:
182                   enum: [nd_sd]
183
184           - if:
185               properties:
186                 function:
187                   const: p0led_an
188             then:
189               properties:
190                 groups:
191                   enum: [p0led_an]
192
193           - if:
194               properties:
195                 function:
196                   const: p0led_kn
197             then:
198               properties:
199                 groups:
200                   enum: [p0led_kn]
201
202           - if:
203               properties:
204                 function:
205                   const: p1led_an
206             then:
207               properties:
208                 groups:
209                   enum: [p1led_an]
210
211           - if:
212               properties:
213                 function:
214                   const: p1led_kn
215             then:
216               properties:
217                 groups:
218                   enum: [p1led_kn]
219
220           - if:
221               properties:
222                 function:
223                   const: p2led_an
224             then:
225               properties:
226                 groups:
227                   enum: [p2led_an]
228
229           - if:
230               properties:
231                 function:
232                   const: p2led_kn
233             then:
234               properties:
235                 groups:
236                   enum: [p2led_kn]
237
238           - if:
239               properties:
240                 function:
241                   const: p3led_an
242             then:
243               properties:
244                 groups:
245                   enum: [p3led_an]
246
247           - if:
248               properties:
249                 function:
250                   const: p3led_kn
251             then:
252               properties:
253                 groups:
254                   enum: [p3led_kn]
255
256           - if:
257               properties:
258                 function:
259                   const: p4led_an
260             then:
261               properties:
262                 groups:
263                   enum: [p4led_an]
264
265           - if:
266               properties:
267                 function:
268                   const: p4led_kn
269             then:
270               properties:
271                 groups:
272                   enum: [p4led_kn]
273
274           - if:
275               properties:
276                 function:
277                   const: pa
278             then:
279               properties:
280                 groups:
281                   enum: [pa]
282
283           - if:
284               properties:
285                 function:
286                   const: pcie
287             then:
288               properties:
289                 groups:
290                   enum: [gpio]
291
292           - if:
293               properties:
294                 function:
295                   const: pcie refclk
296             then:
297               properties:
298                 groups:
299                   enum: [pcie]
300
301           - if:
302               properties:
303                 function:
304                   const: pcie rst
305             then:
306               properties:
307                 groups:
308                   enum: [pcie]
309
310           - if:
311               properties:
312                 function:
313                   const: pcm
314             then:
315               properties:
316                 groups:
317                   enum: [i2s]
318
319           - if:
320               properties:
321                 function:
322                   const: pcm gpio
323             then:
324               properties:
325                 groups:
326                   enum: [uartf]
327
328           - if:
329               properties:
330                 function:
331                   const: pcm i2s
332             then:
333               properties:
334                 groups:
335                   enum: [uartf]
336
337           - if:
338               properties:
339                 function:
340                   const: pcm uartf
341             then:
342               properties:
343                 groups:
344                   enum: [uartf]
345
346           - if:
347               properties:
348                 function:
349                   const: perst
350             then:
351               properties:
352                 groups:
353                   enum: [perst]
354
355           - if:
356               properties:
357                 function:
358                   const: pwm
359             then:
360               properties:
361                 groups:
362                   enum: [uart1, uart2]
363
364           - if:
365               properties:
366                 function:
367                   const: pwm0
368             then:
369               properties:
370                 groups:
371                   enum: [pwm0]
372
373           - if:
374               properties:
375                 function:
376                   const: pwm1
377             then:
378               properties:
379                 groups:
380                   enum: [pwm1]
381
382           - if:
383               properties:
384                 function:
385                   const: pwm_uart2
386             then:
387               properties:
388                 groups:
389                   enum: [spis]
390
391           - if:
392               properties:
393                 function:
394                   const: refclk
395             then:
396               properties:
397                 groups:
398                   anyOf:
399                     - description: For MT7620 SoC
400                       enum: [mdio]
401
402                     - description: For MT7628 and MT7688 SoCs
403                       enum: [gpio, refclk, spi cs1]
404
405           - if:
406               properties:
407                 function:
408                   const: rgmii1
409             then:
410               properties:
411                 groups:
412                   enum: [rgmii1]
413
414           - if:
415               properties:
416                 function:
417                   const: rgmii2
418             then:
419               properties:
420                 groups:
421                   enum: [rgmii2]
422
423           - if:
424               properties:
425                 function:
426                   const: rsvd
427             then:
428               properties:
429                 groups:
430                   enum: [p0led_an, p0led_kn, wled_an, wled_kn]
431
432           - if:
433               properties:
434                 function:
435                   const: sd
436             then:
437               properties:
438                 groups:
439                   enum: [nd_sd]
440
441           - if:
442               properties:
443                 function:
444                   const: sdxc
445             then:
446               properties:
447                 groups:
448                   enum: [sdmode]
449
450           - if:
451               properties:
452                 function:
453                   const: sdxc d5 d4
454             then:
455               properties:
456                 groups:
457                   enum: [uart2]
458
459           - if:
460               properties:
461                 function:
462                   const: sdxc d6
463             then:
464               properties:
465                 groups:
466                   enum: [pwm1]
467
468           - if:
469               properties:
470                 function:
471                   const: sdxc d7
472             then:
473               properties:
474                 groups:
475                   enum: [pwm0]
476
477           - if:
478               properties:
479                 function:
480                   const: spi
481             then:
482               properties:
483                 groups:
484                   enum: [spi]
485
486           - if:
487               properties:
488                 function:
489                   const: spi cs1
490             then:
491               properties:
492                 groups:
493                   enum: [spi cs1]
494
495           - if:
496               properties:
497                 function:
498                   const: spi refclk
499             then:
500               properties:
501                 groups:
502                   enum: [spi refclk]
503
504           - if:
505               properties:
506                 function:
507                   const: spis
508             then:
509               properties:
510                 groups:
511                   enum: [spis]
512
513           - if:
514               properties:
515                 function:
516                   const: sw_r
517             then:
518               properties:
519                 groups:
520                   enum: [uart1]
521
522           - if:
523               properties:
524                 function:
525                   const: uart0
526             then:
527               properties:
528                 groups:
529                   enum: [uart0]
530
531           - if:
532               properties:
533                 function:
534                   const: uart1
535             then:
536               properties:
537                 groups:
538                   enum: [uart1]
539
540           - if:
541               properties:
542                 function:
543                   const: uart2
544             then:
545               properties:
546                 groups:
547                   enum: [uart2]
548
549           - if:
550               properties:
551                 function:
552                   const: uartf
553             then:
554               properties:
555                 groups:
556                   enum: [uartf]
557
558           - if:
559               properties:
560                 function:
561                   const: uartlite
562             then:
563               properties:
564                 groups:
565                   enum: [uartlite]
566
567           - if:
568               properties:
569                 function:
570                   const: utif
571             then:
572               properties:
573                 groups:
574                   enum: [p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an,
575                          p3led_kn, p4led_an, p4led_kn, pwm0, pwm1, sdmode, spis]
576
577           - if:
578               properties:
579                 function:
580                   const: wdt
581             then:
582               properties:
583                 groups:
584                   enum: [wdt]
585
586           - if:
587               properties:
588                 function:
589                   const: wdt refclk
590             then:
591               properties:
592                 groups:
593                   enum: [wdt]
594
595           - if:
596               properties:
597                 function:
598                   const: wdt rst
599             then:
600               properties:
601                 groups:
602                   enum: [wdt]
603
604           - if:
605               properties:
606                 function:
607                   const: wled
608             then:
609               properties:
610                 groups:
611                   enum: [wled]
612
613           - if:
614               properties:
615                 function:
616                   const: wled_an
617             then:
618               properties:
619                 groups:
620                   enum: [wled_an]
621
622           - if:
623               properties:
624                 function:
625                   const: wled_kn
626             then:
627               properties:
628                 groups:
629                   enum: [wled_kn]
630
631           - if:
632               properties:
633                 function:
634                   const: "-"
635             then:
636               properties:
637                 groups:
638                   enum: [i2c, spi cs1, uart0]
639
640 allOf:
641   - $ref: pinctrl.yaml#
642
643 required:
644   - compatible
645
646 additionalProperties: false
647
648 examples:
649   - |
650     pinctrl {
651       compatible = "ralink,mt7620-pinctrl";
652
653       i2c_pins: i2c0-pins {
654         pinmux {
655           groups = "i2c";
656           function = "i2c";
657         };
658       };
659     };