xref: /OK3568_Linux_fs/kernel/drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Allwinner A64 SoCs pinctrl driver.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2016 - ARM Ltd.
5*4882a593Smuzhiyun  * Author: Andre Przywara <andre.przywara@arm.com>
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Based on pinctrl-sun7i-a20.c, which is:
8*4882a593Smuzhiyun  * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
9*4882a593Smuzhiyun  *
10*4882a593Smuzhiyun  * This file is licensed under the terms of the GNU General Public
11*4882a593Smuzhiyun  * License version 2.  This program is licensed "as is" without any
12*4882a593Smuzhiyun  * warranty of any kind, whether express or implied.
13*4882a593Smuzhiyun  */
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun #include <linux/module.h>
16*4882a593Smuzhiyun #include <linux/platform_device.h>
17*4882a593Smuzhiyun #include <linux/of.h>
18*4882a593Smuzhiyun #include <linux/of_device.h>
19*4882a593Smuzhiyun #include <linux/pinctrl/pinctrl.h>
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #include "pinctrl-sunxi.h"
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun static const struct sunxi_desc_pin a64_pins[] = {
24*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
25*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
26*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
27*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
28*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "jtag"),		/* MS0 */
29*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),	/* EINT0 */
30*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
31*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
32*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
33*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RX */
34*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "jtag"),		/* CK0 */
35*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* VCCEN */
36*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),		/* EINT1 */
37*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
38*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
39*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
40*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RTS */
41*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "jtag"),		/* DO0 */
42*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* VPPEN */
43*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),		/* EINT2 */
44*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
45*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
46*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
47*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* CTS */
48*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s0"),		/* MCLK */
49*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "jtag"),		/* DI0 */
50*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* VPPPP */
51*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),		/* EINT3 */
52*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
53*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
54*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
55*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif2"),		/* SYNC */
56*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s0"),		/* SYNC */
57*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* CLK */
58*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),		/* EINT4 */
59*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
60*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
61*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
62*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif2"),		/* BCLK */
63*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s0"),		/* BCLK */
64*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* DATA */
65*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),		/* EINT5 */
66*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
67*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
68*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
69*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif2"),		/* DOUT */
70*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s0"),		/* DOUT */
71*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* RST */
72*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),		/* EINT6 */
73*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
74*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
75*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
76*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif2"),		/* DIN */
77*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s0"),		/* DIN */
78*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "sim"),		/* DET */
79*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),		/* EINT7 */
80*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
81*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
82*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
83*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "uart0"),		/* TX */
84*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)),		/* EINT8 */
85*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
86*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
87*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
88*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "uart0"),		/* RX */
89*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)),		/* EINT9 */
90*4882a593Smuzhiyun 	/* Hole */
91*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
92*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
93*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
94*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NWE */
95*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi0")),		/* MOSI */
96*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
97*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
98*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
99*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NALE */
100*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2"),		/* DS */
101*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi0")),		/* MISO */
102*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
103*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
104*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
105*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NCLE */
106*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi0")),		/* SCK */
107*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
108*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
109*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
110*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NCE1 */
111*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi0")),		/* CS */
112*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
113*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
114*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
115*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0")),	/* NCE0 */
116*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
117*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
118*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
119*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NRE# */
120*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* CLK */
121*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
122*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
123*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
124*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NRB0 */
125*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* CMD */
126*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
127*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
128*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
129*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0")),	/* NRB1 */
130*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
131*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
132*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
133*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ0 */
134*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D0 */
135*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
136*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
137*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
138*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ1 */
139*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D1 */
140*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
141*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
142*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
143*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ2 */
144*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D2 */
145*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
146*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
147*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
148*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ3 */
149*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D3 */
150*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
151*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
152*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
153*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ4 */
154*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D4 */
155*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
156*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
157*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
158*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ5 */
159*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D5 */
160*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
161*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
162*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
163*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ6 */
164*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D6 */
165*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
166*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
167*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
168*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQ7 */
169*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D7 */
170*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
171*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
172*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
173*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "nand0"),		/* NDQS */
174*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* RST */
175*4882a593Smuzhiyun 	/* Hole */
176*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
177*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
178*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
179*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D2 */
180*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart3"),		/* TX */
181*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi1"),		/* CS */
182*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* CLK */
183*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
184*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
185*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
186*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D3 */
187*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart3"),		/* RX */
188*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi1"),		/* CLK */
189*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* DE */
190*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
191*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
192*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
193*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D4 */
194*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart4"),		/* TX */
195*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi1"),		/* MOSI */
196*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* HSYNC */
197*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
198*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
199*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
200*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D5 */
201*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart4"),		/* RX */
202*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "spi1"),		/* MISO */
203*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* VSYNC */
204*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
205*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
206*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
207*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D6 */
208*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart4"),		/* RTS */
209*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D0 */
210*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
211*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
212*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
213*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D7 */
214*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart4"),		/* CTS */
215*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D1 */
216*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
217*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
218*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
219*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D10 */
220*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D2 */
221*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
222*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
223*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
224*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D11 */
225*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D3 */
226*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
227*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
228*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
229*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D12 */
230*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac"),		/* ERXD3 */
231*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D4 */
232*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
233*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
234*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
235*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D13 */
236*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac"),		/* ERXD2 */
237*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D5 */
238*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
239*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
240*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
241*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D14 */
242*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ERXD1 */
243*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
244*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
245*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
246*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D15 */
247*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ERXD0 */
248*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
249*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
250*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
251*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D18 */
252*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VP0 */
253*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ERXCK */
254*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
255*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
256*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
257*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D19 */
258*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VN0 */
259*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ERXCTL */
260*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
261*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
262*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
263*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D20 */
264*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VP1 */
265*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ENULL */
266*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
267*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
268*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
269*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D21 */
270*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VN1 */
271*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac"),		/* ETXD3 */
272*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D6 */
273*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
274*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
275*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
276*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D22 */
277*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VP2 */
278*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac"),		/* ETXD2 */
279*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x5, "ccir")),		/* D7 */
280*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
281*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
282*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
283*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D23 */
284*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VN2 */
285*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ETXD1 */
286*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
287*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
288*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
289*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* CLK */
290*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VPC */
291*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ETXD0 */
292*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
293*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
294*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
295*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* DE */
296*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VNC */
297*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ETXCK */
298*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
299*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
300*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
301*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* HSYNC */
302*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VP3 */
303*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ETXCTL */
304*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
305*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
306*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
307*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* VSYNC */
308*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lvds0"),		/* VN3 */
309*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* ECLKIN */
310*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
311*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
312*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
313*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "pwm"),		/* PWM0 */
314*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* EMDC */
315*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
316*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
317*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
318*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "emac")),		/* EMDIO */
319*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
320*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
321*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out")),
322*4882a593Smuzhiyun 	/* Hole */
323*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
324*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
325*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
326*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* PCK */
327*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* CLK */
328*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
329*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
330*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
331*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* CK */
332*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* ERR */
333*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
334*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
335*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
336*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* HSYNC */
337*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* SYNC */
338*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
339*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
340*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
341*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* VSYNC */
342*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* DVLD */
343*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
344*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
345*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
346*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D0 */
347*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D0 */
348*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
349*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
350*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
351*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D1 */
352*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D1 */
353*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
354*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
355*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
356*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D2 */
357*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D2 */
358*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
359*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
360*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
361*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D3 */
362*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D3 */
363*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
364*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
365*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
366*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D4 */
367*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D4 */
368*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
369*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
370*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
371*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D5 */
372*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D5 */
373*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
374*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
375*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
376*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D6 */
377*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D6 */
378*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
379*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
380*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
381*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D7 */
382*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "ts")),		/* D7 */
383*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
384*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
385*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
386*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi")),		/* SCK */
387*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
388*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
389*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
390*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi")),		/* SDA */
391*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
392*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
393*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
394*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "pll"),		/* LOCK_DBG */
395*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2c2")),		/* SCK */
396*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
397*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
398*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
399*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2c2")),		/* SDA */
400*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
401*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
402*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out")),
403*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
404*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
405*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out")),
406*4882a593Smuzhiyun 	/* Hole */
407*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
408*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
409*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
410*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D1 */
411*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* MSI */
412*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
413*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
414*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
415*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D0 */
416*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DI1 */
417*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
418*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
419*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
420*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CLK */
421*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart0")),	/* TX */
422*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
423*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
424*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
425*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CMD */
426*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DO1 */
427*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
428*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
429*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
430*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D3 */
431*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart0")),	/* RX */
432*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
433*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
434*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
435*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D2 */
436*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* CK1 */
437*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
438*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
439*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out")),
440*4882a593Smuzhiyun 	/* Hole */
441*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
442*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
443*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
444*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CLK */
445*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),	/* EINT0 */
446*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
447*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
448*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
449*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CMD */
450*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),	/* EINT1 */
451*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
452*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
453*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
454*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D0 */
455*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),	/* EINT2 */
456*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
457*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
458*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
459*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D1 */
460*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),	/* EINT3 */
461*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
462*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
463*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
464*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D2 */
465*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),	/* EINT4 */
466*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
467*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
468*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
469*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D3 */
470*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),	/* EINT5 */
471*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
472*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
473*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
474*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart1"),		/* TX */
475*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),	/* EINT6 */
476*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
477*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
478*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
479*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart1"),		/* RX */
480*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),	/* EINT7 */
481*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
482*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
483*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
484*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart1"),		/* RTS */
485*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),	/* EINT8 */
486*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
487*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
488*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
489*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart1"),		/* CTS */
490*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),	/* EINT9 */
491*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
492*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
493*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
494*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif3"),		/* SYNC */
495*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s1"),		/* SYNC */
496*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),	/* EINT10 */
497*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
498*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
499*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
500*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif3"),		/* BCLK */
501*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s1"),		/* BCLK */
502*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),	/* EINT11 */
503*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
504*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
505*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
506*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif3"),		/* DOUT */
507*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s1"),		/* DOUT */
508*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),	/* EINT12 */
509*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
510*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
511*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
512*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "aif3"),		/* DIN */
513*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2s1"),		/* DIN */
514*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),	/* EINT13 */
515*4882a593Smuzhiyun 	/* Hole */
516*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
517*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
518*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
519*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c0"),		/* SCK */
520*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)),	/* EINT0 */
521*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
522*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
523*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
524*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c0"),		/* SDA */
525*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)),	/* EINT1 */
526*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
527*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
528*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
529*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c1"),		/* SCK */
530*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)),	/* EINT2 */
531*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
532*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
533*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
534*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c1"),		/* SDA */
535*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)),	/* EINT3 */
536*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
537*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
538*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
539*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart3"),		/* TX */
540*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)),	/* EINT4 */
541*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
542*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
543*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
544*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart3"),		/* RX */
545*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)),	/* EINT5 */
546*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
547*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
548*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
549*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart3"),		/* RTS */
550*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)),	/* EINT6 */
551*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
552*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
553*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
554*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart3"),		/* CTS */
555*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)),	/* EINT7 */
556*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
557*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
558*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
559*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "spdif"),		/* OUT */
560*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)),	/* EINT8 */
561*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
562*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
563*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
564*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)),	/* EINT9 */
565*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
566*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
567*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
568*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mic"),		/* CLK */
569*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)),	/* EINT10 */
570*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
571*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
572*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
573*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mic"),		/* DATA */
574*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)),	/* EINT11 */
575*4882a593Smuzhiyun };
576*4882a593Smuzhiyun 
577*4882a593Smuzhiyun static const struct sunxi_pinctrl_desc a64_pinctrl_data = {
578*4882a593Smuzhiyun 	.pins = a64_pins,
579*4882a593Smuzhiyun 	.npins = ARRAY_SIZE(a64_pins),
580*4882a593Smuzhiyun 	.irq_banks = 3,
581*4882a593Smuzhiyun };
582*4882a593Smuzhiyun 
a64_pinctrl_probe(struct platform_device * pdev)583*4882a593Smuzhiyun static int a64_pinctrl_probe(struct platform_device *pdev)
584*4882a593Smuzhiyun {
585*4882a593Smuzhiyun 	return sunxi_pinctrl_init(pdev,
586*4882a593Smuzhiyun 				  &a64_pinctrl_data);
587*4882a593Smuzhiyun }
588*4882a593Smuzhiyun 
589*4882a593Smuzhiyun static const struct of_device_id a64_pinctrl_match[] = {
590*4882a593Smuzhiyun 	{ .compatible = "allwinner,sun50i-a64-pinctrl", },
591*4882a593Smuzhiyun 	{}
592*4882a593Smuzhiyun };
593*4882a593Smuzhiyun 
594*4882a593Smuzhiyun static struct platform_driver a64_pinctrl_driver = {
595*4882a593Smuzhiyun 	.probe	= a64_pinctrl_probe,
596*4882a593Smuzhiyun 	.driver	= {
597*4882a593Smuzhiyun 		.name		= "sun50i-a64-pinctrl",
598*4882a593Smuzhiyun 		.of_match_table	= a64_pinctrl_match,
599*4882a593Smuzhiyun 	},
600*4882a593Smuzhiyun };
601*4882a593Smuzhiyun builtin_platform_driver(a64_pinctrl_driver);
602