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