xref: /linux/drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c (revision a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0)
156d9e4a7SIcenowy Zheng /*
2*fb18f188SIcenowy Zheng  * Allwinner V3/V3s SoCs pinctrl driver.
356d9e4a7SIcenowy Zheng  *
456d9e4a7SIcenowy Zheng  * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
556d9e4a7SIcenowy Zheng  *
656d9e4a7SIcenowy Zheng  * Based on pinctrl-sun8i-h3.c, which is:
756d9e4a7SIcenowy Zheng  * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com>
856d9e4a7SIcenowy Zheng  *
956d9e4a7SIcenowy Zheng  * Based on pinctrl-sun8i-a23.c, which is:
1056d9e4a7SIcenowy Zheng  * Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org>
1156d9e4a7SIcenowy Zheng  * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
1256d9e4a7SIcenowy Zheng  *
1356d9e4a7SIcenowy Zheng  * This file is licensed under the terms of the GNU General Public
1456d9e4a7SIcenowy Zheng  * License version 2.  This program is licensed "as is" without any
1556d9e4a7SIcenowy Zheng  * warranty of any kind, whether express or implied.
1656d9e4a7SIcenowy Zheng  */
1756d9e4a7SIcenowy Zheng 
1856d9e4a7SIcenowy Zheng #include <linux/module.h>
1956d9e4a7SIcenowy Zheng #include <linux/platform_device.h>
2056d9e4a7SIcenowy Zheng #include <linux/of.h>
2156d9e4a7SIcenowy Zheng #include <linux/pinctrl/pinctrl.h>
2256d9e4a7SIcenowy Zheng 
2356d9e4a7SIcenowy Zheng #include "pinctrl-sunxi.h"
2456d9e4a7SIcenowy Zheng 
2556d9e4a7SIcenowy Zheng static const struct sunxi_desc_pin sun8i_v3s_pins[] = {
2656d9e4a7SIcenowy Zheng 	/* Hole */
2756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
2856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
3156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),	/* PB_EINT0 */
3256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
3356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RX */
3656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),	/* PB_EINT1 */
3756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
3856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RTS */
4156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),	/* PB_EINT2 */
4256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
4356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "uart2"),		/* D1 */
4656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),	/* PB_EINT3 */
4756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
4856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "pwm0"),
5156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),	/* PB_EINT4 */
5256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
5356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "pwm1"),
5656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),	/* PB_EINT5 */
5756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
5856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
6056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "i2c0"),		/* SCK */
6156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),	/* PB_EINT6 */
6256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
6356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
6456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
6556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "i2c0"),		/* SDA */
6656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),	/* PB_EINT7 */
6756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
6856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
6956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
7056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "i2c1"),		/* SDA */
7156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "uart0"),		/* TX */
7256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)),	/* PB_EINT8 */
7356d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
7456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
7556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
7656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "i2c1"),		/* SCK */
7756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "uart0"),		/* RX */
7856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)),	/* PB_EINT9 */
79*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 10),
80*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
81*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
82*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
83*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "jtag"),		/* MS */
84*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),	/* PB_EINT10 */
85*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 11),
86*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
87*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
88*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
89*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "jtag"),		/* CK */
90*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),	/* PB_EINT11 */
91*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 12),
92*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
93*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
94*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
95*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "jtag"),		/* DO */
96*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),	/* PB_EINT12 */
97*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 13),
98*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
99*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
100*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
101*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "jtag"),		/* DI */
102*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),	/* PB_EINT13 */
10356d9e4a7SIcenowy Zheng 	/* Hole */
10456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
10556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
10656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
10756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* CLK */
10856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "spi0")),		/* MISO */
10956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
11056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
11156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
11256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* CMD */
11356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "spi0")),		/* CLK */
11456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
11556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
11656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
11756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* RST */
11856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "spi0")),		/* CS */
11956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
12056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
12156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
12256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc2"),		/* D0 */
12356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "spi0")),		/* MOSI */
124*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 4),
125*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
126*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
127*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
128*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D1 */
129*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 5),
130*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
131*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
132*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
133*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D2 */
134*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 6),
135*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
136*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
137*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
138*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D3 */
139*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 7),
140*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
141*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
142*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
143*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D4 */
144*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 8),
145*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
146*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
147*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
148*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D5 */
149*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 9),
150*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
151*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
152*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
153*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D6 */
154*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 10),
155*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
156*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
157*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
158*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "mmc2")),		/* D7 */
159*fb18f188SIcenowy Zheng 	/* Hole */
160*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 0),
161*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
162*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
163*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
164*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D2 */
165*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD3 */
166*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 1),
167*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
168*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
169*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
170*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D3 */
171*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD2 */
172*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 2),
173*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
174*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
175*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
176*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D4 */
177*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD1 */
178*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 3),
179*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
180*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
181*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
182*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D5 */
183*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXD0 */
184*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 4),
185*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
186*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
187*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
188*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D6 */
189*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXCK */
190*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 5),
191*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
192*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
193*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
194*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D7 */
195*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXCTL/RXDV */
196*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 6),
197*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
198*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
199*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
200*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D10 */
201*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* RXERR */
202*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 7),
203*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
204*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
205*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
206*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D11 */
207*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD3 */
208*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 8),
209*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
210*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
211*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
212*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D12 */
213*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD2 */
214*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 9),
215*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
216*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
217*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
218*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D13 */
219*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD1 */
220*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 10),
221*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
222*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
223*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
224*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D14 */
225*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXD0 */
226*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 11),
227*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
228*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
229*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
230*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D15 */
231*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* CRS */
232*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 12),
233*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
234*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
235*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
236*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D18 */
237*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VP0 */
238*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXCK */
239*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 13),
240*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
241*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
242*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
243*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D19 */
244*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VN0 */
245*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXCTL/TXEN */
246*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 14),
247*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
248*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
249*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
250*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D20 */
251*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VP1 */
252*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* TXERR */
253*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 15),
254*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
255*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
256*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
257*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D21 */
258*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VN1 */
259*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* CLKIN/COL */
260*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 16),
261*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
262*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
263*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
264*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D22 */
265*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VP2 */
266*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* MDC */
267*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 17),
268*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
269*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
270*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
271*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* D23 */
272*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds"),		/* VN2 */
273*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x4, "emac")),		/* MDIO */
274*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 18),
275*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
276*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
277*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
278*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* CLK */
279*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VPC */
280*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 19),
281*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
282*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
283*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
284*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* DE */
285*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VNC */
286*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 20),
287*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
288*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
289*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
290*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* HSYNC */
291*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VP3 */
292*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 21),
293*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
294*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
295*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
296*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "lcd"),		/* VSYNC */
297*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x3, "lvds")),		/* VN3 */
29856d9e4a7SIcenowy Zheng 	/* Hole */
29956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
30056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
30156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
30256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* PCLK */
30356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* CLK */
30456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
30556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
30656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
30756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* MCLK */
30856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* DE */
30956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
31056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
31156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
31256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* HSYNC */
31356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* HSYNC */
31456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
31556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
31656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
31756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* VSYNC */
31856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* VSYNC */
31956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
32056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
32156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
32256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D0 */
32356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D2 */
32456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
32556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
32656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
32756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D1 */
32856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D3 */
32956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
33056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
33156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
33256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D2 */
33356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D4 */
33456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
33556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
33656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
33756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D3 */
33856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D5 */
33956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
34056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
34156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
34256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D4 */
34356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D6 */
34456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
34556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
34656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
34756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D5 */
34856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D7 */
34956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
35056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
35156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
35256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D6 */
35356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D10 */
35456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
35556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
35656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
35756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D7 */
35856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D11 */
35956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
36056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
36156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
36256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D8 */
36356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D12 */
36456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
36556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
36656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
36756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D9 */
36856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D13 */
36956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
37056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
37156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
37256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D10 */
37356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D14 */
37456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
37556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
37656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
37756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D11 */
37856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D15 */
37956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
38056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
38156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
38256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D12 */
38356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D18 */
38456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
38556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
38656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
38756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D13 */
38856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D19 */
38956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),
39056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
39156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
39256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D14 */
39356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D20 */
39456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),
39556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
39656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
39756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* D15 */
39856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd")),		/* D21 */
39956d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 20),
40056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
40156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
40256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* FIELD */
40356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "csi_mipi")),	/* MCLK */
40456d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 21),
40556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
40656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
40756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* SCK */
40856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "i2c1"),		/* SCK */
40956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x4, "uart1")),	/* TX */
41056d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 22),
41156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
41256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
41356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "csi"),		/* SDA */
41456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "i2c1"),		/* SDA */
41556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x4, "uart1")),	/* RX */
41656d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 23),
41756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
41856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
41956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd"),		/* D22 */
42056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x4, "uart1")),	/* RTS */
42156d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 24),
42256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
42356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
42456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "lcd"),		/* D23 */
42556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x4, "uart1")),	/* CTS */
42656d9e4a7SIcenowy Zheng 	/* Hole */
42756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
42856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
42956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
43056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D1 */
43156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "jtag")),		/* MS */
43256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
43356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
43456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
43556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D0 */
43656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DI */
43756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
43856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
43956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
44056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CLK */
44156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "uart0")),	/* TX */
44256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
44356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
44456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
44556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CMD */
44656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DO */
44756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
44856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
44956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
45056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D3 */
45156d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "uart0")),	/* RX */
45256d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
45356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
45456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
45556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D2 */
45656d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x3, "jtag")),		/* CK */
45756d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
45856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
45956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out")),
46056d9e4a7SIcenowy Zheng 	/* Hole */
46156d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
46256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
46356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
46456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CLK */
46556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),	/* PG_EINT0 */
46656d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
46756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
46856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
46956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CMD */
47056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),	/* PG_EINT1 */
47156d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
47256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
47356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
47456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D0 */
47556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),	/* PG_EINT2 */
47656d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
47756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
47856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
47956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D1 */
48056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),	/* PG_EINT3 */
48156d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
48256d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
48356d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
48456d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D2 */
48556d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),	/* PG_EINT4 */
48656d9e4a7SIcenowy Zheng 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
48756d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x0, "gpio_in"),
48856d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x1, "gpio_out"),
48956d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D3 */
49056d9e4a7SIcenowy Zheng 		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),	/* PG_EINT5 */
491*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 6),
492*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
493*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
494*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
495*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "uart1"),		/* TX */
496*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),	/* PG_EINT6 */
497*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 7),
498*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
499*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
500*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
501*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "uart1"),		/* RX */
502*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),	/* PG_EINT7 */
503*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 8),
504*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
505*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
506*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
507*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "uart1"),		/* RTS */
508*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),	/* PG_EINT8 */
509*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 9),
510*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
511*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
512*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
513*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "uart1"),		/* CTS */
514*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),	/* PG_EINT9 */
515*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 10),
516*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
517*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
518*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
519*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "i2s"),		/* SYNC */
520*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),	/* PG_EINT10 */
521*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 11),
522*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
523*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
524*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
525*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "i2s"),		/* BCLK */
526*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),	/* PG_EINT11 */
527*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 12),
528*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
529*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
530*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
531*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "i2s"),		/* DOUT */
532*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),	/* PG_EINT12 */
533*fb18f188SIcenowy Zheng 	SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 13),
534*fb18f188SIcenowy Zheng 			  PINCTRL_SUN8I_V3,
535*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x0, "gpio_in"),
536*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x1, "gpio_out"),
537*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION(0x2, "i2s"),		/* DIN */
538*fb18f188SIcenowy Zheng 			  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),	/* PG_EINT13 */
53956d9e4a7SIcenowy Zheng };
54056d9e4a7SIcenowy Zheng 
54135817d34SIcenowy Zheng static const unsigned int sun8i_v3s_pinctrl_irq_bank_map[] = { 1, 2 };
54235817d34SIcenowy Zheng 
54356d9e4a7SIcenowy Zheng static const struct sunxi_pinctrl_desc sun8i_v3s_pinctrl_data = {
54456d9e4a7SIcenowy Zheng 	.pins = sun8i_v3s_pins,
54556d9e4a7SIcenowy Zheng 	.npins = ARRAY_SIZE(sun8i_v3s_pins),
54656d9e4a7SIcenowy Zheng 	.irq_banks = 2,
54735817d34SIcenowy Zheng 	.irq_bank_map = sun8i_v3s_pinctrl_irq_bank_map,
54856d9e4a7SIcenowy Zheng 	.irq_read_needs_mux = true
54956d9e4a7SIcenowy Zheng };
55056d9e4a7SIcenowy Zheng 
sun8i_v3s_pinctrl_probe(struct platform_device * pdev)55156d9e4a7SIcenowy Zheng static int sun8i_v3s_pinctrl_probe(struct platform_device *pdev)
55256d9e4a7SIcenowy Zheng {
553*fb18f188SIcenowy Zheng 	unsigned long variant = (unsigned long)of_device_get_match_data(&pdev->dev);
554*fb18f188SIcenowy Zheng 
555*fb18f188SIcenowy Zheng 	return sunxi_pinctrl_init_with_variant(pdev, &sun8i_v3s_pinctrl_data,
556*fb18f188SIcenowy Zheng 					       variant);
55756d9e4a7SIcenowy Zheng }
55856d9e4a7SIcenowy Zheng 
55956d9e4a7SIcenowy Zheng static const struct of_device_id sun8i_v3s_pinctrl_match[] = {
560*fb18f188SIcenowy Zheng 	{
561*fb18f188SIcenowy Zheng 		.compatible = "allwinner,sun8i-v3-pinctrl",
562*fb18f188SIcenowy Zheng 		.data = (void *)PINCTRL_SUN8I_V3
563*fb18f188SIcenowy Zheng 	},
564*fb18f188SIcenowy Zheng 	{
565*fb18f188SIcenowy Zheng 		.compatible = "allwinner,sun8i-v3s-pinctrl",
566*fb18f188SIcenowy Zheng 		.data = (void *)PINCTRL_SUN8I_V3S
567*fb18f188SIcenowy Zheng 	},
568*fb18f188SIcenowy Zheng 	{ },
56956d9e4a7SIcenowy Zheng };
57056d9e4a7SIcenowy Zheng 
57156d9e4a7SIcenowy Zheng static struct platform_driver sun8i_v3s_pinctrl_driver = {
57256d9e4a7SIcenowy Zheng 	.probe	= sun8i_v3s_pinctrl_probe,
57356d9e4a7SIcenowy Zheng 	.driver	= {
57456d9e4a7SIcenowy Zheng 		.name		= "sun8i-v3s-pinctrl",
57556d9e4a7SIcenowy Zheng 		.of_match_table	= sun8i_v3s_pinctrl_match,
57656d9e4a7SIcenowy Zheng 	},
57756d9e4a7SIcenowy Zheng };
57856d9e4a7SIcenowy Zheng builtin_platform_driver(sun8i_v3s_pinctrl_driver);
579