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,rt305x-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Ralink RT305X Pin Controller
8
9maintainers:
10  - Arınç ÜNAL <arinc.unal@arinc9.com>
11  - Sergio Paracuellos <sergio.paracuellos@gmail.com>
12
13description:
14  Ralink RT305X pin controller for RT3050, RT3052, RT3350, RT3352 and RT5350
15  SoCs.
16  The pin controller can only set the muxing of pin groups. Muxing individual
17  pins is not supported. There is no pinconf support.
18
19properties:
20  compatible:
21    const: ralink,rt305x-pinctrl
22
23patternProperties:
24  '-pins$':
25    type: object
26    patternProperties:
27      '^(.*-)?pinmux$':
28        type: object
29        description: node for pinctrl.
30        $ref: pinmux-node.yaml#
31
32        properties:
33          function:
34            description:
35              A string containing the name of the function to mux to the group.
36            anyOf:
37              - description: For RT3050, RT3052 and RT3350 SoCs
38                enum: [gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, mdio,
39                       pcm gpio, pcm i2s, pcm uartf, rgmii, sdram, spi, uartf,
40                       uartlite]
41
42              - description: For RT3352 SoC
43                enum: [gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led,
44                       lna, mdio, pa, pcm gpio, pcm i2s, pcm uartf, rgmii, spi,
45                       spi_cs1, uartf, uartlite, wdg_cs1]
46
47              - description: For RT5350 SoC
48                enum: [gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led,
49                       pcm gpio, pcm i2s, pcm uartf, spi, spi_cs1, uartf,
50                       uartlite, wdg_cs1]
51
52          groups:
53            description:
54              An array of strings. Each string contains the name of a group.
55            maxItems: 1
56
57        required:
58          - groups
59          - function
60
61        allOf:
62          - if:
63              properties:
64                function:
65                  const: gpio
66            then:
67              properties:
68                groups:
69                  anyOf:
70                    - description: For RT3050, RT3052 and RT3350 SoCs
71                      enum: [i2c, jtag, mdio, rgmii, sdram, spi, uartf,
72                             uartlite]
73
74                    - description: For RT3352 SoC
75                      enum: [i2c, jtag, led, lna, mdio, pa, rgmii, spi, spi_cs1,
76                             uartf, uartlite]
77
78                    - description: For RT5350 SoC
79                      enum: [i2c, jtag, led, spi, spi_cs1, uartf, uartlite]
80
81          - if:
82              properties:
83                function:
84                  const: gpio i2s
85            then:
86              properties:
87                groups:
88                  enum: [uartf]
89
90          - if:
91              properties:
92                function:
93                  const: gpio uartf
94            then:
95              properties:
96                groups:
97                  enum: [uartf]
98
99          - if:
100              properties:
101                function:
102                  const: i2c
103            then:
104              properties:
105                groups:
106                  enum: [i2c]
107
108          - if:
109              properties:
110                function:
111                  const: i2s uartf
112            then:
113              properties:
114                groups:
115                  enum: [uartf]
116
117          - if:
118              properties:
119                function:
120                  const: jtag
121            then:
122              properties:
123                groups:
124                  enum: [jtag]
125
126          - if:
127              properties:
128                function:
129                  const: led
130            then:
131              properties:
132                groups:
133                  enum: [led]
134
135          - if:
136              properties:
137                function:
138                  const: lna
139            then:
140              properties:
141                groups:
142                  enum: [lna]
143
144          - if:
145              properties:
146                function:
147                  const: mdio
148            then:
149              properties:
150                groups:
151                  enum: [mdio]
152
153          - if:
154              properties:
155                function:
156                  const: pa
157            then:
158              properties:
159                groups:
160                  enum: [pa]
161
162          - if:
163              properties:
164                function:
165                  const: pcm gpio
166            then:
167              properties:
168                groups:
169                  enum: [uartf]
170
171          - if:
172              properties:
173                function:
174                  const: pcm i2s
175            then:
176              properties:
177                groups:
178                  enum: [uartf]
179
180          - if:
181              properties:
182                function:
183                  const: pcm uartf
184            then:
185              properties:
186                groups:
187                  enum: [uartf]
188
189          - if:
190              properties:
191                function:
192                  const: rgmii
193            then:
194              properties:
195                groups:
196                  enum: [rgmii]
197
198          - if:
199              properties:
200                function:
201                  const: sdram
202            then:
203              properties:
204                groups:
205                  enum: [sdram]
206
207          - if:
208              properties:
209                function:
210                  const: spi
211            then:
212              properties:
213                groups:
214                  enum: [spi]
215
216          - if:
217              properties:
218                function:
219                  const: spi_cs1
220            then:
221              properties:
222                groups:
223                  enum: [spi_cs1]
224
225          - if:
226              properties:
227                function:
228                  const: uartf
229            then:
230              properties:
231                groups:
232                  enum: [uartf]
233
234          - if:
235              properties:
236                function:
237                  const: uartlite
238            then:
239              properties:
240                groups:
241                  enum: [uartlite]
242
243          - if:
244              properties:
245                function:
246                  const: wdg_cs1
247            then:
248              properties:
249                groups:
250                  enum: [spi_cs1]
251
252        additionalProperties: false
253
254    additionalProperties: false
255
256allOf:
257  - $ref: "pinctrl.yaml#"
258
259required:
260  - compatible
261
262additionalProperties: false
263
264examples:
265  - |
266    pinctrl {
267      compatible = "ralink,rt305x-pinctrl";
268
269      i2c_pins: i2c0-pins {
270        pinmux {
271          groups = "i2c";
272          function = "i2c";
273        };
274      };
275    };
276