xref: /OK3568_Linux_fs/kernel/drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Allwinner V3/V3s SoCs pinctrl driver.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Based on pinctrl-sun8i-h3.c, which is:
7*4882a593Smuzhiyun  * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com>
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * Based on pinctrl-sun8i-a23.c, which is:
10*4882a593Smuzhiyun  * Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org>
11*4882a593Smuzhiyun  * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * This file is licensed under the terms of the GNU General Public
14*4882a593Smuzhiyun  * License version 2.  This program is licensed "as is" without any
15*4882a593Smuzhiyun  * warranty of any kind, whether express or implied.
16*4882a593Smuzhiyun  */
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun #include <linux/module.h>
19*4882a593Smuzhiyun #include <linux/platform_device.h>
20*4882a593Smuzhiyun #include <linux/of.h>
21*4882a593Smuzhiyun #include <linux/of_device.h>
22*4882a593Smuzhiyun #include <linux/pinctrl/pinctrl.h>
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #include "pinctrl-sunxi.h"
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun static const struct sunxi_desc_pin sun8i_v3s_pins[] = {
27*4882a593Smuzhiyun 	/* Hole */
28*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
29*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
30*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
31*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
32*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),	/* PB_EINT0 */
33*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
34*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
35*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
36*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RX */
37*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),	/* PB_EINT1 */
38*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
39*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
40*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
41*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RTS */
42*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),	/* PB_EINT2 */
43*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
44*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
45*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
46*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "uart2"),		/* D1 */
47*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),	/* PB_EINT3 */
48*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
49*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
50*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
51*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "pwm0"),
52*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),	/* PB_EINT4 */
53*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
54*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
55*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
56*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "pwm1"),
57*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),	/* PB_EINT5 */
58*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
59*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
60*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
61*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c0"),		/* SCK */
62*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),	/* PB_EINT6 */
63*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
64*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
65*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
66*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c0"),		/* SDA */
67*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),	/* PB_EINT7 */
68*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
69*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
70*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
71*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c1"),		/* SDA */
72*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart0"),		/* TX */
73*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)),	/* PB_EINT8 */
74*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
75*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
76*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
77*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "i2c1"),		/* SCK */
78*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart0"),		/* RX */
79*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)),	/* PB_EINT9 */
80*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 10),
81*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
82*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
83*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
84*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "jtag"),		/* MS */
85*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),	/* PB_EINT10 */
86*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 11),
87*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
88*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
89*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
90*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "jtag"),		/* CK */
91*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),	/* PB_EINT11 */
92*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 12),
93*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
94*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
95*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
96*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "jtag"),		/* DO */
97*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),	/* PB_EINT12 */
98*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 13),
99*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
100*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
101*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
102*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "jtag"),		/* DI */
103*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),	/* PB_EINT13 */
104*4882a593Smuzhiyun 	/* Hole */
105*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
106*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
107*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
108*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* CLK */
109*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "spi0")),		/* MISO */
110*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
111*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
112*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
113*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* CMD */
114*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "spi0")),		/* CLK */
115*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
116*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
117*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
118*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* RST */
119*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "spi0")),		/* CS */
120*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
121*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
122*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
123*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* D0 */
124*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "spi0")),		/* MOSI */
125*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 4),
126*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
127*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
128*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
129*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D1 */
130*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 5),
131*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
132*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
133*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
134*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D2 */
135*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 6),
136*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
137*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
138*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
139*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D3 */
140*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 7),
141*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
142*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
143*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
144*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D4 */
145*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 8),
146*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
147*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
148*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
149*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D5 */
150*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 9),
151*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
152*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
153*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
154*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D6 */
155*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 10),
156*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
157*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
158*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
159*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D7 */
160*4882a593Smuzhiyun 	/* Hole */
161*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 0),
162*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
163*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
164*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
165*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D2 */
166*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD3 */
167*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 1),
168*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
169*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
170*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
171*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D3 */
172*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD2 */
173*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 2),
174*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
175*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
176*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
177*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D4 */
178*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD1 */
179*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 3),
180*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
181*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
182*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
183*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D5 */
184*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD0 */
185*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 4),
186*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
187*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
188*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
189*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D6 */
190*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXCK */
191*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 5),
192*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
193*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
194*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
195*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D7 */
196*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXCTL/RXDV */
197*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 6),
198*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
199*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
200*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
201*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D10 */
202*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXERR */
203*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 7),
204*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
205*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
206*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
207*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D11 */
208*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD3 */
209*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 8),
210*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
211*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
212*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
213*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D12 */
214*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD2 */
215*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 9),
216*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
217*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
218*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
219*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D13 */
220*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD1 */
221*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 10),
222*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
223*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
224*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
225*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D14 */
226*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD0 */
227*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 11),
228*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
229*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
230*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
231*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D15 */
232*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* CRS */
233*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 12),
234*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
235*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
236*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
237*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D18 */
238*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VP0 */
239*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXCK */
240*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 13),
241*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
242*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
243*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
244*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D19 */
245*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VN0 */
246*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXCTL/TXEN */
247*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 14),
248*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
249*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
250*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
251*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D20 */
252*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VP1 */
253*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXERR */
254*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 15),
255*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
256*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
257*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
258*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D21 */
259*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VN1 */
260*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* CLKIN/COL */
261*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 16),
262*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
263*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
264*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
265*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D22 */
266*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VP2 */
267*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* MDC */
268*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 17),
269*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
270*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
271*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
272*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D23 */
273*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VN2 */
274*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x4, "emac")),		/* MDIO */
275*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 18),
276*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
277*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
278*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
279*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* CLK */
280*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VPC */
281*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 19),
282*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
283*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
284*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
285*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* DE */
286*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VNC */
287*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 20),
288*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
289*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
290*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
291*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* HSYNC */
292*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VP3 */
293*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 21),
294*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
295*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
296*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
297*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "lcd"),		/* VSYNC */
298*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VN3 */
299*4882a593Smuzhiyun 	/* Hole */
300*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
301*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
302*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
303*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* PCLK */
304*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* CLK */
305*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
306*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
307*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
308*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* MCLK */
309*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* DE */
310*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
311*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
312*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
313*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* HSYNC */
314*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* HSYNC */
315*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
316*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
317*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
318*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* VSYNC */
319*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* VSYNC */
320*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
321*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
322*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
323*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D0 */
324*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D2 */
325*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
326*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
327*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
328*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D1 */
329*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D3 */
330*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
331*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
332*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
333*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D2 */
334*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D4 */
335*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
336*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
337*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
338*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D3 */
339*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D5 */
340*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
341*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
342*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
343*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D4 */
344*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D6 */
345*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
346*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
347*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
348*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D5 */
349*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D7 */
350*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
351*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
352*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
353*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D6 */
354*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D10 */
355*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
356*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
357*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
358*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D7 */
359*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D11 */
360*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
361*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
362*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
363*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D8 */
364*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D12 */
365*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
366*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
367*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
368*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D9 */
369*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D13 */
370*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
371*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
372*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
373*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D10 */
374*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D14 */
375*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
376*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
377*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
378*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D11 */
379*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D15 */
380*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
381*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
382*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
383*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D12 */
384*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D18 */
385*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
386*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
387*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
388*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D13 */
389*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D19 */
390*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),
391*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
392*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
393*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D14 */
394*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D20 */
395*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),
396*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
397*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
398*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* D15 */
399*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D21 */
400*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 20),
401*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
402*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
403*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* FIELD */
404*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "csi_mipi")),	/* MCLK */
405*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 21),
406*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
407*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
408*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* SCK */
409*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2c1"),		/* SCK */
410*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "uart1")),	/* TX */
411*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 22),
412*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
413*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
414*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "csi"),		/* SDA */
415*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "i2c1"),		/* SDA */
416*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "uart1")),	/* RX */
417*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 23),
418*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
419*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
420*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd"),		/* D22 */
421*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "uart1")),	/* RTS */
422*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 24),
423*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
424*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
425*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "lcd"),		/* D23 */
426*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x4, "uart1")),	/* CTS */
427*4882a593Smuzhiyun 	/* Hole */
428*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
429*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
430*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
431*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D1 */
432*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* MS */
433*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
434*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
435*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
436*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D0 */
437*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DI */
438*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
439*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
440*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
441*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CLK */
442*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart0")),	/* TX */
443*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
444*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
445*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
446*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CMD */
447*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DO */
448*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
449*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
450*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
451*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D3 */
452*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "uart0")),	/* RX */
453*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
454*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
455*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
456*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D2 */
457*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x3, "jtag")),		/* CK */
458*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
459*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
460*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out")),
461*4882a593Smuzhiyun 	/* Hole */
462*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
463*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
464*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
465*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CLK */
466*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),	/* PG_EINT0 */
467*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
468*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
469*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
470*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CMD */
471*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),	/* PG_EINT1 */
472*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
473*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
474*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
475*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D0 */
476*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),	/* PG_EINT2 */
477*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
478*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
479*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
480*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D1 */
481*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),	/* PG_EINT3 */
482*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
483*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
484*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
485*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D2 */
486*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),	/* PG_EINT4 */
487*4882a593Smuzhiyun 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
488*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x0, "gpio_in"),
489*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x1, "gpio_out"),
490*4882a593Smuzhiyun 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D3 */
491*4882a593Smuzhiyun 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),	/* PG_EINT5 */
492*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 6),
493*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
494*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
495*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
496*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "uart1"),		/* TX */
497*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),	/* PG_EINT6 */
498*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 7),
499*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
500*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
501*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
502*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "uart1"),		/* RX */
503*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),	/* PG_EINT7 */
504*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 8),
505*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
506*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
507*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
508*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "uart1"),		/* RTS */
509*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),	/* PG_EINT8 */
510*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 9),
511*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
512*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
513*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
514*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "uart1"),		/* CTS */
515*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),	/* PG_EINT9 */
516*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 10),
517*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
518*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
519*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
520*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "i2s"),		/* SYNC */
521*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),	/* PG_EINT10 */
522*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 11),
523*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
524*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
525*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
526*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "i2s"),		/* BCLK */
527*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),	/* PG_EINT11 */
528*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 12),
529*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
530*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
531*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
532*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "i2s"),		/* DOUT */
533*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),	/* PG_EINT12 */
534*4882a593Smuzhiyun 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 13),
535*4882a593Smuzhiyun 			  PINCTRL_SUN8I_V3,
536*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x0, "gpio_in"),
537*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x1, "gpio_out"),
538*4882a593Smuzhiyun 			  SUNXI_FUNCTION(0x2, "i2s"),		/* DIN */
539*4882a593Smuzhiyun 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),	/* PG_EINT13 */
540*4882a593Smuzhiyun };
541*4882a593Smuzhiyun 
542*4882a593Smuzhiyun static const unsigned int sun8i_v3s_pinctrl_irq_bank_map[] = { 1, 2 };
543*4882a593Smuzhiyun 
544*4882a593Smuzhiyun static const struct sunxi_pinctrl_desc sun8i_v3s_pinctrl_data = {
545*4882a593Smuzhiyun 	.pins = sun8i_v3s_pins,
546*4882a593Smuzhiyun 	.npins = ARRAY_SIZE(sun8i_v3s_pins),
547*4882a593Smuzhiyun 	.irq_banks = 2,
548*4882a593Smuzhiyun 	.irq_bank_map = sun8i_v3s_pinctrl_irq_bank_map,
549*4882a593Smuzhiyun 	.irq_read_needs_mux = true
550*4882a593Smuzhiyun };
551*4882a593Smuzhiyun 
sun8i_v3s_pinctrl_probe(struct platform_device * pdev)552*4882a593Smuzhiyun static int sun8i_v3s_pinctrl_probe(struct platform_device *pdev)
553*4882a593Smuzhiyun {
554*4882a593Smuzhiyun 	unsigned long variant = (unsigned long)of_device_get_match_data(&pdev->dev);
555*4882a593Smuzhiyun 
556*4882a593Smuzhiyun 	return sunxi_pinctrl_init_with_variant(pdev, &sun8i_v3s_pinctrl_data,
557*4882a593Smuzhiyun 					       variant);
558*4882a593Smuzhiyun }
559*4882a593Smuzhiyun 
560*4882a593Smuzhiyun static const struct of_device_id sun8i_v3s_pinctrl_match[] = {
561*4882a593Smuzhiyun 	{
562*4882a593Smuzhiyun 		.compatible = "allwinner,sun8i-v3-pinctrl",
563*4882a593Smuzhiyun 		.data = (void *)PINCTRL_SUN8I_V3
564*4882a593Smuzhiyun 	},
565*4882a593Smuzhiyun 	{
566*4882a593Smuzhiyun 		.compatible = "allwinner,sun8i-v3s-pinctrl",
567*4882a593Smuzhiyun 		.data = (void *)PINCTRL_SUN8I_V3S
568*4882a593Smuzhiyun 	},
569*4882a593Smuzhiyun 	{ },
570*4882a593Smuzhiyun };
571*4882a593Smuzhiyun 
572*4882a593Smuzhiyun static struct platform_driver sun8i_v3s_pinctrl_driver = {
573*4882a593Smuzhiyun 	.probe	= sun8i_v3s_pinctrl_probe,
574*4882a593Smuzhiyun 	.driver	= {
575*4882a593Smuzhiyun 		.name		= "sun8i-v3s-pinctrl",
576*4882a593Smuzhiyun 		.of_match_table	= sun8i_v3s_pinctrl_match,
577*4882a593Smuzhiyun 	},
578*4882a593Smuzhiyun };
579*4882a593Smuzhiyun builtin_platform_driver(sun8i_v3s_pinctrl_driver);
580