This source file includes following definitions.
- sun8i_v3s_pinctrl_probe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <linux/module.h>
19 #include <linux/platform_device.h>
20 #include <linux/of.h>
21 #include <linux/of_device.h>
22 #include <linux/pinctrl/pinctrl.h>
23
24 #include "pinctrl-sunxi.h"
25
26 static const struct sunxi_desc_pin sun8i_v3s_pins[] = {
27
28 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
29 SUNXI_FUNCTION(0x0, "gpio_in"),
30 SUNXI_FUNCTION(0x1, "gpio_out"),
31 SUNXI_FUNCTION(0x2, "uart2"),
32 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),
33 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
34 SUNXI_FUNCTION(0x0, "gpio_in"),
35 SUNXI_FUNCTION(0x1, "gpio_out"),
36 SUNXI_FUNCTION(0x2, "uart2"),
37 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),
38 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
39 SUNXI_FUNCTION(0x0, "gpio_in"),
40 SUNXI_FUNCTION(0x1, "gpio_out"),
41 SUNXI_FUNCTION(0x2, "uart2"),
42 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),
43 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
44 SUNXI_FUNCTION(0x0, "gpio_in"),
45 SUNXI_FUNCTION(0x1, "gpio_out"),
46 SUNXI_FUNCTION(0x2, "uart2"),
47 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),
48 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
49 SUNXI_FUNCTION(0x0, "gpio_in"),
50 SUNXI_FUNCTION(0x1, "gpio_out"),
51 SUNXI_FUNCTION(0x2, "pwm0"),
52 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),
53 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
54 SUNXI_FUNCTION(0x0, "gpio_in"),
55 SUNXI_FUNCTION(0x1, "gpio_out"),
56 SUNXI_FUNCTION(0x2, "pwm1"),
57 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),
58 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
59 SUNXI_FUNCTION(0x0, "gpio_in"),
60 SUNXI_FUNCTION(0x1, "gpio_out"),
61 SUNXI_FUNCTION(0x2, "i2c0"),
62 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),
63 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
64 SUNXI_FUNCTION(0x0, "gpio_in"),
65 SUNXI_FUNCTION(0x1, "gpio_out"),
66 SUNXI_FUNCTION(0x2, "i2c0"),
67 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),
68 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
69 SUNXI_FUNCTION(0x0, "gpio_in"),
70 SUNXI_FUNCTION(0x1, "gpio_out"),
71 SUNXI_FUNCTION(0x2, "i2c1"),
72 SUNXI_FUNCTION(0x3, "uart0"),
73 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)),
74 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
75 SUNXI_FUNCTION(0x0, "gpio_in"),
76 SUNXI_FUNCTION(0x1, "gpio_out"),
77 SUNXI_FUNCTION(0x2, "i2c1"),
78 SUNXI_FUNCTION(0x3, "uart0"),
79 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)),
80 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 10),
81 PINCTRL_SUN8I_V3,
82 SUNXI_FUNCTION(0x0, "gpio_in"),
83 SUNXI_FUNCTION(0x1, "gpio_out"),
84 SUNXI_FUNCTION(0x2, "jtag"),
85 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),
86 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 11),
87 PINCTRL_SUN8I_V3,
88 SUNXI_FUNCTION(0x0, "gpio_in"),
89 SUNXI_FUNCTION(0x1, "gpio_out"),
90 SUNXI_FUNCTION(0x2, "jtag"),
91 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),
92 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 12),
93 PINCTRL_SUN8I_V3,
94 SUNXI_FUNCTION(0x0, "gpio_in"),
95 SUNXI_FUNCTION(0x1, "gpio_out"),
96 SUNXI_FUNCTION(0x2, "jtag"),
97 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),
98 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 13),
99 PINCTRL_SUN8I_V3,
100 SUNXI_FUNCTION(0x0, "gpio_in"),
101 SUNXI_FUNCTION(0x1, "gpio_out"),
102 SUNXI_FUNCTION(0x2, "jtag"),
103 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),
104
105 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
106 SUNXI_FUNCTION(0x0, "gpio_in"),
107 SUNXI_FUNCTION(0x1, "gpio_out"),
108 SUNXI_FUNCTION(0x2, "mmc2"),
109 SUNXI_FUNCTION(0x3, "spi0")),
110 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
111 SUNXI_FUNCTION(0x0, "gpio_in"),
112 SUNXI_FUNCTION(0x1, "gpio_out"),
113 SUNXI_FUNCTION(0x2, "mmc2"),
114 SUNXI_FUNCTION(0x3, "spi0")),
115 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
116 SUNXI_FUNCTION(0x0, "gpio_in"),
117 SUNXI_FUNCTION(0x1, "gpio_out"),
118 SUNXI_FUNCTION(0x2, "mmc2"),
119 SUNXI_FUNCTION(0x3, "spi0")),
120 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
121 SUNXI_FUNCTION(0x0, "gpio_in"),
122 SUNXI_FUNCTION(0x1, "gpio_out"),
123 SUNXI_FUNCTION(0x2, "mmc2"),
124 SUNXI_FUNCTION(0x3, "spi0")),
125 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 4),
126 PINCTRL_SUN8I_V3,
127 SUNXI_FUNCTION(0x0, "gpio_in"),
128 SUNXI_FUNCTION(0x1, "gpio_out"),
129 SUNXI_FUNCTION(0x2, "mmc2")),
130 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 5),
131 PINCTRL_SUN8I_V3,
132 SUNXI_FUNCTION(0x0, "gpio_in"),
133 SUNXI_FUNCTION(0x1, "gpio_out"),
134 SUNXI_FUNCTION(0x2, "mmc2")),
135 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 6),
136 PINCTRL_SUN8I_V3,
137 SUNXI_FUNCTION(0x0, "gpio_in"),
138 SUNXI_FUNCTION(0x1, "gpio_out"),
139 SUNXI_FUNCTION(0x2, "mmc2")),
140 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 7),
141 PINCTRL_SUN8I_V3,
142 SUNXI_FUNCTION(0x0, "gpio_in"),
143 SUNXI_FUNCTION(0x1, "gpio_out"),
144 SUNXI_FUNCTION(0x2, "mmc2")),
145 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 8),
146 PINCTRL_SUN8I_V3,
147 SUNXI_FUNCTION(0x0, "gpio_in"),
148 SUNXI_FUNCTION(0x1, "gpio_out"),
149 SUNXI_FUNCTION(0x2, "mmc2")),
150 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 9),
151 PINCTRL_SUN8I_V3,
152 SUNXI_FUNCTION(0x0, "gpio_in"),
153 SUNXI_FUNCTION(0x1, "gpio_out"),
154 SUNXI_FUNCTION(0x2, "mmc2")),
155 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 10),
156 PINCTRL_SUN8I_V3,
157 SUNXI_FUNCTION(0x0, "gpio_in"),
158 SUNXI_FUNCTION(0x1, "gpio_out"),
159 SUNXI_FUNCTION(0x2, "mmc2")),
160
161 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 0),
162 PINCTRL_SUN8I_V3,
163 SUNXI_FUNCTION(0x0, "gpio_in"),
164 SUNXI_FUNCTION(0x1, "gpio_out"),
165 SUNXI_FUNCTION(0x2, "lcd"),
166 SUNXI_FUNCTION(0x4, "emac")),
167 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 1),
168 PINCTRL_SUN8I_V3,
169 SUNXI_FUNCTION(0x0, "gpio_in"),
170 SUNXI_FUNCTION(0x1, "gpio_out"),
171 SUNXI_FUNCTION(0x2, "lcd"),
172 SUNXI_FUNCTION(0x4, "emac")),
173 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 2),
174 PINCTRL_SUN8I_V3,
175 SUNXI_FUNCTION(0x0, "gpio_in"),
176 SUNXI_FUNCTION(0x1, "gpio_out"),
177 SUNXI_FUNCTION(0x2, "lcd"),
178 SUNXI_FUNCTION(0x4, "emac")),
179 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 3),
180 PINCTRL_SUN8I_V3,
181 SUNXI_FUNCTION(0x0, "gpio_in"),
182 SUNXI_FUNCTION(0x1, "gpio_out"),
183 SUNXI_FUNCTION(0x2, "lcd"),
184 SUNXI_FUNCTION(0x4, "emac")),
185 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 4),
186 PINCTRL_SUN8I_V3,
187 SUNXI_FUNCTION(0x0, "gpio_in"),
188 SUNXI_FUNCTION(0x1, "gpio_out"),
189 SUNXI_FUNCTION(0x2, "lcd"),
190 SUNXI_FUNCTION(0x4, "emac")),
191 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 5),
192 PINCTRL_SUN8I_V3,
193 SUNXI_FUNCTION(0x0, "gpio_in"),
194 SUNXI_FUNCTION(0x1, "gpio_out"),
195 SUNXI_FUNCTION(0x2, "lcd"),
196 SUNXI_FUNCTION(0x4, "emac")),
197 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 6),
198 PINCTRL_SUN8I_V3,
199 SUNXI_FUNCTION(0x0, "gpio_in"),
200 SUNXI_FUNCTION(0x1, "gpio_out"),
201 SUNXI_FUNCTION(0x2, "lcd"),
202 SUNXI_FUNCTION(0x4, "emac")),
203 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 7),
204 PINCTRL_SUN8I_V3,
205 SUNXI_FUNCTION(0x0, "gpio_in"),
206 SUNXI_FUNCTION(0x1, "gpio_out"),
207 SUNXI_FUNCTION(0x2, "lcd"),
208 SUNXI_FUNCTION(0x4, "emac")),
209 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 8),
210 PINCTRL_SUN8I_V3,
211 SUNXI_FUNCTION(0x0, "gpio_in"),
212 SUNXI_FUNCTION(0x1, "gpio_out"),
213 SUNXI_FUNCTION(0x2, "lcd"),
214 SUNXI_FUNCTION(0x4, "emac")),
215 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 9),
216 PINCTRL_SUN8I_V3,
217 SUNXI_FUNCTION(0x0, "gpio_in"),
218 SUNXI_FUNCTION(0x1, "gpio_out"),
219 SUNXI_FUNCTION(0x2, "lcd"),
220 SUNXI_FUNCTION(0x4, "emac")),
221 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 10),
222 PINCTRL_SUN8I_V3,
223 SUNXI_FUNCTION(0x0, "gpio_in"),
224 SUNXI_FUNCTION(0x1, "gpio_out"),
225 SUNXI_FUNCTION(0x2, "lcd"),
226 SUNXI_FUNCTION(0x4, "emac")),
227 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 11),
228 PINCTRL_SUN8I_V3,
229 SUNXI_FUNCTION(0x0, "gpio_in"),
230 SUNXI_FUNCTION(0x1, "gpio_out"),
231 SUNXI_FUNCTION(0x2, "lcd"),
232 SUNXI_FUNCTION(0x4, "emac")),
233 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 12),
234 PINCTRL_SUN8I_V3,
235 SUNXI_FUNCTION(0x0, "gpio_in"),
236 SUNXI_FUNCTION(0x1, "gpio_out"),
237 SUNXI_FUNCTION(0x2, "lcd"),
238 SUNXI_FUNCTION(0x3, "lvds"),
239 SUNXI_FUNCTION(0x4, "emac")),
240 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 13),
241 PINCTRL_SUN8I_V3,
242 SUNXI_FUNCTION(0x0, "gpio_in"),
243 SUNXI_FUNCTION(0x1, "gpio_out"),
244 SUNXI_FUNCTION(0x2, "lcd"),
245 SUNXI_FUNCTION(0x3, "lvds"),
246 SUNXI_FUNCTION(0x4, "emac")),
247 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 14),
248 PINCTRL_SUN8I_V3,
249 SUNXI_FUNCTION(0x0, "gpio_in"),
250 SUNXI_FUNCTION(0x1, "gpio_out"),
251 SUNXI_FUNCTION(0x2, "lcd"),
252 SUNXI_FUNCTION(0x3, "lvds"),
253 SUNXI_FUNCTION(0x4, "emac")),
254 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 15),
255 PINCTRL_SUN8I_V3,
256 SUNXI_FUNCTION(0x0, "gpio_in"),
257 SUNXI_FUNCTION(0x1, "gpio_out"),
258 SUNXI_FUNCTION(0x2, "lcd"),
259 SUNXI_FUNCTION(0x3, "lvds"),
260 SUNXI_FUNCTION(0x4, "emac")),
261 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 16),
262 PINCTRL_SUN8I_V3,
263 SUNXI_FUNCTION(0x0, "gpio_in"),
264 SUNXI_FUNCTION(0x1, "gpio_out"),
265 SUNXI_FUNCTION(0x2, "lcd"),
266 SUNXI_FUNCTION(0x3, "lvds"),
267 SUNXI_FUNCTION(0x4, "emac")),
268 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 17),
269 PINCTRL_SUN8I_V3,
270 SUNXI_FUNCTION(0x0, "gpio_in"),
271 SUNXI_FUNCTION(0x1, "gpio_out"),
272 SUNXI_FUNCTION(0x2, "lcd"),
273 SUNXI_FUNCTION(0x3, "lvds"),
274 SUNXI_FUNCTION(0x4, "emac")),
275 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 18),
276 PINCTRL_SUN8I_V3,
277 SUNXI_FUNCTION(0x0, "gpio_in"),
278 SUNXI_FUNCTION(0x1, "gpio_out"),
279 SUNXI_FUNCTION(0x2, "lcd"),
280 SUNXI_FUNCTION(0x3, "lvds")),
281 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 19),
282 PINCTRL_SUN8I_V3,
283 SUNXI_FUNCTION(0x0, "gpio_in"),
284 SUNXI_FUNCTION(0x1, "gpio_out"),
285 SUNXI_FUNCTION(0x2, "lcd"),
286 SUNXI_FUNCTION(0x3, "lvds")),
287 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 20),
288 PINCTRL_SUN8I_V3,
289 SUNXI_FUNCTION(0x0, "gpio_in"),
290 SUNXI_FUNCTION(0x1, "gpio_out"),
291 SUNXI_FUNCTION(0x2, "lcd"),
292 SUNXI_FUNCTION(0x3, "lvds")),
293 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 21),
294 PINCTRL_SUN8I_V3,
295 SUNXI_FUNCTION(0x0, "gpio_in"),
296 SUNXI_FUNCTION(0x1, "gpio_out"),
297 SUNXI_FUNCTION(0x2, "lcd"),
298 SUNXI_FUNCTION(0x3, "lvds")),
299
300 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
301 SUNXI_FUNCTION(0x0, "gpio_in"),
302 SUNXI_FUNCTION(0x1, "gpio_out"),
303 SUNXI_FUNCTION(0x2, "csi"),
304 SUNXI_FUNCTION(0x3, "lcd")),
305 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
306 SUNXI_FUNCTION(0x0, "gpio_in"),
307 SUNXI_FUNCTION(0x1, "gpio_out"),
308 SUNXI_FUNCTION(0x2, "csi"),
309 SUNXI_FUNCTION(0x3, "lcd")),
310 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
311 SUNXI_FUNCTION(0x0, "gpio_in"),
312 SUNXI_FUNCTION(0x1, "gpio_out"),
313 SUNXI_FUNCTION(0x2, "csi"),
314 SUNXI_FUNCTION(0x3, "lcd")),
315 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
316 SUNXI_FUNCTION(0x0, "gpio_in"),
317 SUNXI_FUNCTION(0x1, "gpio_out"),
318 SUNXI_FUNCTION(0x2, "csi"),
319 SUNXI_FUNCTION(0x3, "lcd")),
320 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
321 SUNXI_FUNCTION(0x0, "gpio_in"),
322 SUNXI_FUNCTION(0x1, "gpio_out"),
323 SUNXI_FUNCTION(0x2, "csi"),
324 SUNXI_FUNCTION(0x3, "lcd")),
325 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
326 SUNXI_FUNCTION(0x0, "gpio_in"),
327 SUNXI_FUNCTION(0x1, "gpio_out"),
328 SUNXI_FUNCTION(0x2, "csi"),
329 SUNXI_FUNCTION(0x3, "lcd")),
330 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
331 SUNXI_FUNCTION(0x0, "gpio_in"),
332 SUNXI_FUNCTION(0x1, "gpio_out"),
333 SUNXI_FUNCTION(0x2, "csi"),
334 SUNXI_FUNCTION(0x3, "lcd")),
335 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
336 SUNXI_FUNCTION(0x0, "gpio_in"),
337 SUNXI_FUNCTION(0x1, "gpio_out"),
338 SUNXI_FUNCTION(0x2, "csi"),
339 SUNXI_FUNCTION(0x3, "lcd")),
340 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
341 SUNXI_FUNCTION(0x0, "gpio_in"),
342 SUNXI_FUNCTION(0x1, "gpio_out"),
343 SUNXI_FUNCTION(0x2, "csi"),
344 SUNXI_FUNCTION(0x3, "lcd")),
345 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
346 SUNXI_FUNCTION(0x0, "gpio_in"),
347 SUNXI_FUNCTION(0x1, "gpio_out"),
348 SUNXI_FUNCTION(0x2, "csi"),
349 SUNXI_FUNCTION(0x3, "lcd")),
350 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
351 SUNXI_FUNCTION(0x0, "gpio_in"),
352 SUNXI_FUNCTION(0x1, "gpio_out"),
353 SUNXI_FUNCTION(0x2, "csi"),
354 SUNXI_FUNCTION(0x3, "lcd")),
355 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
356 SUNXI_FUNCTION(0x0, "gpio_in"),
357 SUNXI_FUNCTION(0x1, "gpio_out"),
358 SUNXI_FUNCTION(0x2, "csi"),
359 SUNXI_FUNCTION(0x3, "lcd")),
360 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
361 SUNXI_FUNCTION(0x0, "gpio_in"),
362 SUNXI_FUNCTION(0x1, "gpio_out"),
363 SUNXI_FUNCTION(0x2, "csi"),
364 SUNXI_FUNCTION(0x3, "lcd")),
365 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
366 SUNXI_FUNCTION(0x0, "gpio_in"),
367 SUNXI_FUNCTION(0x1, "gpio_out"),
368 SUNXI_FUNCTION(0x2, "csi"),
369 SUNXI_FUNCTION(0x3, "lcd")),
370 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
371 SUNXI_FUNCTION(0x0, "gpio_in"),
372 SUNXI_FUNCTION(0x1, "gpio_out"),
373 SUNXI_FUNCTION(0x2, "csi"),
374 SUNXI_FUNCTION(0x3, "lcd")),
375 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
376 SUNXI_FUNCTION(0x0, "gpio_in"),
377 SUNXI_FUNCTION(0x1, "gpio_out"),
378 SUNXI_FUNCTION(0x2, "csi"),
379 SUNXI_FUNCTION(0x3, "lcd")),
380 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
381 SUNXI_FUNCTION(0x0, "gpio_in"),
382 SUNXI_FUNCTION(0x1, "gpio_out"),
383 SUNXI_FUNCTION(0x2, "csi"),
384 SUNXI_FUNCTION(0x3, "lcd")),
385 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
386 SUNXI_FUNCTION(0x0, "gpio_in"),
387 SUNXI_FUNCTION(0x1, "gpio_out"),
388 SUNXI_FUNCTION(0x2, "csi"),
389 SUNXI_FUNCTION(0x3, "lcd")),
390 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),
391 SUNXI_FUNCTION(0x0, "gpio_in"),
392 SUNXI_FUNCTION(0x1, "gpio_out"),
393 SUNXI_FUNCTION(0x2, "csi"),
394 SUNXI_FUNCTION(0x3, "lcd")),
395 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),
396 SUNXI_FUNCTION(0x0, "gpio_in"),
397 SUNXI_FUNCTION(0x1, "gpio_out"),
398 SUNXI_FUNCTION(0x2, "csi"),
399 SUNXI_FUNCTION(0x3, "lcd")),
400 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 20),
401 SUNXI_FUNCTION(0x0, "gpio_in"),
402 SUNXI_FUNCTION(0x1, "gpio_out"),
403 SUNXI_FUNCTION(0x2, "csi"),
404 SUNXI_FUNCTION(0x3, "csi_mipi")),
405 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 21),
406 SUNXI_FUNCTION(0x0, "gpio_in"),
407 SUNXI_FUNCTION(0x1, "gpio_out"),
408 SUNXI_FUNCTION(0x2, "csi"),
409 SUNXI_FUNCTION(0x3, "i2c1"),
410 SUNXI_FUNCTION(0x4, "uart1")),
411 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 22),
412 SUNXI_FUNCTION(0x0, "gpio_in"),
413 SUNXI_FUNCTION(0x1, "gpio_out"),
414 SUNXI_FUNCTION(0x2, "csi"),
415 SUNXI_FUNCTION(0x3, "i2c1"),
416 SUNXI_FUNCTION(0x4, "uart1")),
417 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 23),
418 SUNXI_FUNCTION(0x0, "gpio_in"),
419 SUNXI_FUNCTION(0x1, "gpio_out"),
420 SUNXI_FUNCTION(0x3, "lcd"),
421 SUNXI_FUNCTION(0x4, "uart1")),
422 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 24),
423 SUNXI_FUNCTION(0x0, "gpio_in"),
424 SUNXI_FUNCTION(0x1, "gpio_out"),
425 SUNXI_FUNCTION(0x3, "lcd"),
426 SUNXI_FUNCTION(0x4, "uart1")),
427
428 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
429 SUNXI_FUNCTION(0x0, "gpio_in"),
430 SUNXI_FUNCTION(0x1, "gpio_out"),
431 SUNXI_FUNCTION(0x2, "mmc0"),
432 SUNXI_FUNCTION(0x3, "jtag")),
433 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
434 SUNXI_FUNCTION(0x0, "gpio_in"),
435 SUNXI_FUNCTION(0x1, "gpio_out"),
436 SUNXI_FUNCTION(0x2, "mmc0"),
437 SUNXI_FUNCTION(0x3, "jtag")),
438 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
439 SUNXI_FUNCTION(0x0, "gpio_in"),
440 SUNXI_FUNCTION(0x1, "gpio_out"),
441 SUNXI_FUNCTION(0x2, "mmc0"),
442 SUNXI_FUNCTION(0x3, "uart0")),
443 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
444 SUNXI_FUNCTION(0x0, "gpio_in"),
445 SUNXI_FUNCTION(0x1, "gpio_out"),
446 SUNXI_FUNCTION(0x2, "mmc0"),
447 SUNXI_FUNCTION(0x3, "jtag")),
448 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
449 SUNXI_FUNCTION(0x0, "gpio_in"),
450 SUNXI_FUNCTION(0x1, "gpio_out"),
451 SUNXI_FUNCTION(0x2, "mmc0"),
452 SUNXI_FUNCTION(0x3, "uart0")),
453 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
454 SUNXI_FUNCTION(0x0, "gpio_in"),
455 SUNXI_FUNCTION(0x1, "gpio_out"),
456 SUNXI_FUNCTION(0x2, "mmc0"),
457 SUNXI_FUNCTION(0x3, "jtag")),
458 SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
459 SUNXI_FUNCTION(0x0, "gpio_in"),
460 SUNXI_FUNCTION(0x1, "gpio_out")),
461
462 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
463 SUNXI_FUNCTION(0x0, "gpio_in"),
464 SUNXI_FUNCTION(0x1, "gpio_out"),
465 SUNXI_FUNCTION(0x2, "mmc1"),
466 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),
467 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
468 SUNXI_FUNCTION(0x0, "gpio_in"),
469 SUNXI_FUNCTION(0x1, "gpio_out"),
470 SUNXI_FUNCTION(0x2, "mmc1"),
471 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),
472 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
473 SUNXI_FUNCTION(0x0, "gpio_in"),
474 SUNXI_FUNCTION(0x1, "gpio_out"),
475 SUNXI_FUNCTION(0x2, "mmc1"),
476 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),
477 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
478 SUNXI_FUNCTION(0x0, "gpio_in"),
479 SUNXI_FUNCTION(0x1, "gpio_out"),
480 SUNXI_FUNCTION(0x2, "mmc1"),
481 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),
482 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
483 SUNXI_FUNCTION(0x0, "gpio_in"),
484 SUNXI_FUNCTION(0x1, "gpio_out"),
485 SUNXI_FUNCTION(0x2, "mmc1"),
486 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),
487 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
488 SUNXI_FUNCTION(0x0, "gpio_in"),
489 SUNXI_FUNCTION(0x1, "gpio_out"),
490 SUNXI_FUNCTION(0x2, "mmc1"),
491 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),
492 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 6),
493 PINCTRL_SUN8I_V3,
494 SUNXI_FUNCTION(0x0, "gpio_in"),
495 SUNXI_FUNCTION(0x1, "gpio_out"),
496 SUNXI_FUNCTION(0x2, "uart1"),
497 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),
498 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 7),
499 PINCTRL_SUN8I_V3,
500 SUNXI_FUNCTION(0x0, "gpio_in"),
501 SUNXI_FUNCTION(0x1, "gpio_out"),
502 SUNXI_FUNCTION(0x2, "uart1"),
503 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),
504 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 8),
505 PINCTRL_SUN8I_V3,
506 SUNXI_FUNCTION(0x0, "gpio_in"),
507 SUNXI_FUNCTION(0x1, "gpio_out"),
508 SUNXI_FUNCTION(0x2, "uart1"),
509 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),
510 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 9),
511 PINCTRL_SUN8I_V3,
512 SUNXI_FUNCTION(0x0, "gpio_in"),
513 SUNXI_FUNCTION(0x1, "gpio_out"),
514 SUNXI_FUNCTION(0x2, "uart1"),
515 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),
516 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 10),
517 PINCTRL_SUN8I_V3,
518 SUNXI_FUNCTION(0x0, "gpio_in"),
519 SUNXI_FUNCTION(0x1, "gpio_out"),
520 SUNXI_FUNCTION(0x2, "i2s"),
521 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),
522 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 11),
523 PINCTRL_SUN8I_V3,
524 SUNXI_FUNCTION(0x0, "gpio_in"),
525 SUNXI_FUNCTION(0x1, "gpio_out"),
526 SUNXI_FUNCTION(0x2, "i2s"),
527 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),
528 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 12),
529 PINCTRL_SUN8I_V3,
530 SUNXI_FUNCTION(0x0, "gpio_in"),
531 SUNXI_FUNCTION(0x1, "gpio_out"),
532 SUNXI_FUNCTION(0x2, "i2s"),
533 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),
534 SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 13),
535 PINCTRL_SUN8I_V3,
536 SUNXI_FUNCTION(0x0, "gpio_in"),
537 SUNXI_FUNCTION(0x1, "gpio_out"),
538 SUNXI_FUNCTION(0x2, "i2s"),
539 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),
540 };
541
542 static const unsigned int sun8i_v3s_pinctrl_irq_bank_map[] = { 1, 2 };
543
544 static const struct sunxi_pinctrl_desc sun8i_v3s_pinctrl_data = {
545 .pins = sun8i_v3s_pins,
546 .npins = ARRAY_SIZE(sun8i_v3s_pins),
547 .irq_banks = 2,
548 .irq_bank_map = sun8i_v3s_pinctrl_irq_bank_map,
549 .irq_read_needs_mux = true
550 };
551
552 static int sun8i_v3s_pinctrl_probe(struct platform_device *pdev)
553 {
554 unsigned long variant = (unsigned long)of_device_get_match_data(&pdev->dev);
555
556 return sunxi_pinctrl_init_with_variant(pdev, &sun8i_v3s_pinctrl_data,
557 variant);
558 }
559
560 static const struct of_device_id sun8i_v3s_pinctrl_match[] = {
561 {
562 .compatible = "allwinner,sun8i-v3-pinctrl",
563 .data = (void *)PINCTRL_SUN8I_V3
564 },
565 {
566 .compatible = "allwinner,sun8i-v3s-pinctrl",
567 .data = (void *)PINCTRL_SUN8I_V3S
568 },
569 { },
570 };
571
572 static struct platform_driver sun8i_v3s_pinctrl_driver = {
573 .probe = sun8i_v3s_pinctrl_probe,
574 .driver = {
575 .name = "sun8i-v3s-pinctrl",
576 .of_match_table = sun8i_v3s_pinctrl_match,
577 },
578 };
579 builtin_platform_driver(sun8i_v3s_pinctrl_driver);