xref: /openbmc/linux/drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
14c821d1cSChen-Yu Tsai /*
24c821d1cSChen-Yu Tsai  * Allwinner A23 SoCs pinctrl driver.
34c821d1cSChen-Yu Tsai  *
44c821d1cSChen-Yu Tsai  * Copyright (C) 2014 Chen-Yu Tsai
54c821d1cSChen-Yu Tsai  *
64c821d1cSChen-Yu Tsai  * Chen-Yu Tsai <wens@csie.org>
74c821d1cSChen-Yu Tsai  *
84c821d1cSChen-Yu Tsai  * Copyright (C) 2014 Maxime Ripard
94c821d1cSChen-Yu Tsai  *
104c821d1cSChen-Yu Tsai  * Maxime Ripard <maxime.ripard@free-electrons.com>
114c821d1cSChen-Yu Tsai  *
124c821d1cSChen-Yu Tsai  * This file is licensed under the terms of the GNU General Public
134c821d1cSChen-Yu Tsai  * License version 2.  This program is licensed "as is" without any
144c821d1cSChen-Yu Tsai  * warranty of any kind, whether express or implied.
154c821d1cSChen-Yu Tsai  */
164c821d1cSChen-Yu Tsai 
170c8c6ba0SPaul Gortmaker #include <linux/init.h>
184c821d1cSChen-Yu Tsai #include <linux/platform_device.h>
194c821d1cSChen-Yu Tsai #include <linux/of.h>
204c821d1cSChen-Yu Tsai #include <linux/pinctrl/pinctrl.h>
214c821d1cSChen-Yu Tsai 
224c821d1cSChen-Yu Tsai #include "pinctrl-sunxi.h"
234c821d1cSChen-Yu Tsai 
244c821d1cSChen-Yu Tsai static const struct sunxi_desc_pin sun8i_a23_pins[] = {
254c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
264c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
274c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
284c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi1"),		/* CS */
294c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag"),		/* MS0 */
304c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 0)),	/* PA_EINT0 */
314c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
324c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
334c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
344c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi1"),		/* CLK */
354c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag"),		/* CKO */
364c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 1)),	/* PA_EINT1 */
374c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
384c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
394c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
404c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi1"),		/* MOSI */
414c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag"),		/* DOO */
424c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 2)),	/* PA_EINT2 */
434c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
444c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
454c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
464c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi1"),		/* MISO */
474c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag"),		/* DIO */
484c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 3)),	/* PA_EINT3 */
494c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
504c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
514c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
524c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart4"),		/* TX */
534c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 4)),	/* PA_EINT4 */
544c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
554c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
564c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
574c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart4"),		/* RX */
584c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 5)),	/* PA_EINT5 */
594c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
604c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
614c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
624c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart4"),		/* RTS */
634c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 6)),	/* PA_EINT6 */
644c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
654c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
664c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
674c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart4"),		/* CTS */
684c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 7)),	/* PA_EINT7 */
694c821d1cSChen-Yu Tsai 	/* Hole */
704c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
714c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
724c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
734c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
744c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 0)),	/* PB_EINT0 */
754c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
764c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
774c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
784c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RX */
794c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 1)),	/* PB_EINT1 */
804c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
814c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
824c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
834c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart2"),		/* RTS */
844c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 2)),	/* PB_EINT2 */
854c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
864c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
874c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
884c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart2"),		/* CTS */
894c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 3)),	/* PB_EINT3 */
904c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
914c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
924c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
934c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s0"),		/* SYNC */
944c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 4)),	/* PB_EINT4 */
954c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
964c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
974c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
984c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s0"),		/* DOUT */
994c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 5)),	/* PB_EINT5 */
1004c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
1014c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1024c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1034c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s0"),		/* DIN */
1044c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 6)),	/* PB_EINT6 */
1054c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
1064c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1074c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1084c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2s0"),		/* DI */
1094c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 7)),	/* PB_EINT7 */
1104c821d1cSChen-Yu Tsai 	/* Hole */
1114c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
1124c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1134c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1144c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* WE */
1154c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "spi0")),		/* MOSI */
1164c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
1174c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1184c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1194c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* ALE */
1204c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "spi0")),		/* MISO */
1214c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
1224c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1234c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1244c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* CLE */
1254c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "spi0")),		/* CLK */
1264c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
1274c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1284c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1294c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* CE1 */
1304c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "spi0")),		/* CS */
1314c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
1324c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1334c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1344c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0")),	/* CE0 */
1354c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
1364c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1374c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1384c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* RE */
1394c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* CLK */
1404c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
1414c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1424c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1434c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* RB0 */
1444c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* CMD */
1454c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
1464c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1474c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1484c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0")),	/* RB1 */
1494c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
1504c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1514c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1524c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ0 */
1534c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D0 */
1544c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
1554c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1564c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1574c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ1 */
1584c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D1 */
1594c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
1604c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1614c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1624c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ2 */
1634c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D2 */
1644c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
1654c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1664c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1674c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ3 */
1684c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D3 */
1694c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
1704c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1714c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1724c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ4 */
1734c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D4 */
1744c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
1754c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1764c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1774c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ5 */
1784c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D5 */
1794c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
1804c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1814c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
182bc0f566aSIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ6 */
1834c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D6 */
1844c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
1854c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1864c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
187bc0f566aSIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ7 */
1884c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* D7 */
1894c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
1904c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1914c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
192bc0f566aSIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQS */
1934c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc2")),		/* RST */
1944c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
1954c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
1964c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
1974c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0")),	/* CE2 */
1984c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
1994c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2004c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2014c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "nand0")),	/* CE3 */
2024c821d1cSChen-Yu Tsai 	/* Hole */
2034c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
2044c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2054c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2064c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0")),		/* D0 */
2074c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
2084c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2094c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2104c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0")),		/* D1 */
2114c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
2124c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2134c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2144c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D2 */
2154c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc1")),		/* CLK */
2164c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
2174c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2184c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2194c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D3 */
2204c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc1")),		/* CMD */
2214c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
2224c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2234c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2244c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D4 */
2254c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc1")),		/* D0 */
2264c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
2274c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2284c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2294c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D5 */
2304c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc1")),		/* D1 */
2314c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
2324c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2334c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2344c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D6 */
2354c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc1")),		/* D2 */
2364c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
2374c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2384c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2394c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D7 */
2404c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "mmc1")),		/* D3 */
2414c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
2424c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2434c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2444c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D8 */
2454c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart3")),	/* TX */
2464c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
2474c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2484c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2494c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D9 */
2504c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart3")),	/* RX */
2514c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
2524c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2534c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2544c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D10 */
2554c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart1")),	/* TX */
2564c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
2574c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2584c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2594c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D11 */
2604c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart1")),	/* RX */
2614c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
2624c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2634c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2644c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D12 */
2654c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart1")),	/* RTS */
2664c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
2674c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2684c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2694c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D13 */
2704c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart1")),	/* CTS */
2714c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
2724c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2734c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2744c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D14 */
2754c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2s1")),		/* SYNC */
2764c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
2774c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2784c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2794c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D15 */
2804c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2s1")),		/* CLK */
2814c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
2824c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2834c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2844c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D16 */
2854c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2s1")),		/* DOUT */
2864c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
2874c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2884c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2894c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D17 */
2904c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2s1")),		/* DIN */
2914c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
2924c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2934c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2944c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D18 */
2954c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VN0 */
2964c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
2974c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
2984c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
2994c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D19 */
3004c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VP0 */
3014c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
3024c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3034c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3044c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D20 */
3054c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VP1 */
3064c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
3074c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3084c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3094c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D21 */
3104c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VN1 */
3114c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
3124c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3134c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3144c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D22 */
3154c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VP2 */
3164c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
3174c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3184c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3194c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* D23 */
3204c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VN2 */
3214c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
3224c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3234c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3244c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* CLK */
3254c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VPC */
3264c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
3274c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3284c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3294c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* DE */
3304c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VNC */
3314c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
3324c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3334c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3344c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* HSYNC */
3354c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VP3 */
3364c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
3374c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3384c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3394c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "lcd0"),		/* VSYNC */
3404c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "lvds0")),	/* VN3 */
3414c821d1cSChen-Yu Tsai 	/* Hole */
3424c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
3434c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3444c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3454c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* PCLK */
3464c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
3474c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3484c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3494c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* MCLK */
3504c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
3514c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3524c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3534c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* HSYNC */
3544c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
3554c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3564c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3574c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* VSYNC */
3584c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
3594c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3604c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3614c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D0 */
3624c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
3634c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3644c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3654c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D1 */
3664c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
3674c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3684c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3694c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D2 */
3704c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
3714c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3724c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3734c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D3 */
3744c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
3754c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3764c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3774c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D4 */
3784c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
3794c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3804c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3814c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D5 */
3824c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
3834c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3844c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3854c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D6 */
3864c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
3874c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3884c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3894c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi")),		/* D7 */
3904c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
3914c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3924c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3934c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi"),		/* SCK */
3944c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2c2")),		/* SCK */
3954c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
3964c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
3974c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
3984c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "csi"),		/* SDA */
3994c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "i2c2")),		/* SDA */
4004c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
4014c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4024c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out")),
4034c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
4044c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4054c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out")),
4064c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
4074c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4084c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out")),
4094c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
4104c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4114c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out")),
4124c821d1cSChen-Yu Tsai 	/* Hole */
4134c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
4144c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4154c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4164c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D1 */
4174c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag")),		/* MS1 */
4184c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
4194c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4204c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4214c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D0 */
4224c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DI1 */
4234c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
4244c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4254c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4264c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CLK */
4274c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart0")),	/* TX */
4284c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
4294c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4304c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4314c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CMD */
4324c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag")),		/* DO1 */
4334c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
4344c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4354c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4364c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D3 */
4374c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart0")),	/* RX */
4384c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
4394c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4404c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4414c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D2 */
4424c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "jtag")),		/* CK1 */
4434c821d1cSChen-Yu Tsai 	/* Hole */
4444c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
4454c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4464c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4474c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CLK */
4484c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 0)),	/* PG_EINT0 */
4494c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
4504c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4514c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4524c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CMD */
4534c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 1)),	/* PG_EINT1 */
4544c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
4554c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4564c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4574c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D0 */
4584c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 2)),	/* PG_EINT2 */
4594c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
4604c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4614c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4624c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D1 */
4634c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 3)),	/* PG_EINT3 */
4644c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
4654c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4664c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4674c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D2 */
4684c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 4)),	/* PG_EINT4 */
4694c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
4704c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4714c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4724c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D3 */
4734c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 5)),	/* PG_EINT5 */
4744c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
4754c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4764c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4774c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart1"),		/* TX */
4784c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 6)),	/* PG_EINT6 */
4794c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
4804c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4814c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4824c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "uart1"),		/* RX */
4834c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 7)),	/* PG_EINT7 */
4844c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
4854c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4864c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
487486095faSIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "uart1"),		/* RTS */
4884c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 8)),	/* PG_EINT8 */
4894c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
4904c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4914c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
492486095faSIcenowy Zheng 		  SUNXI_FUNCTION(0x2, "uart1"),		/* CTS */
4934c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 9)),	/* PG_EINT9 */
4944c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
4954c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
4964c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
4974c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s1"),		/* SYNC */
4984c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 10)),	/* PG_EINT10 */
4994c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
5004c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5014c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5024c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s1"),		/* CLK */
5034c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 11)),	/* PG_EINT11 */
5044c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
5054c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5064c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5074c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s1"),		/* DOUT */
5084c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 12)),	/* PG_EINT12 */
5094c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
5104c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5114c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5124c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2s1"),		/* DIN */
5134c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 13)),	/* PG_EINT13 */
5144c821d1cSChen-Yu Tsai 	/* Hole */
5154c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
5164c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5174c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5184c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "pwm0")),
5194c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
5204c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5214c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5224c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "pwm1")),
5234c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
5244c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5254c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5264c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2c0")),		/* SCK */
5274c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
5284c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5294c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5304c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2c0")),		/* SDA */
5314c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
5324c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5334c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5344c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2c1")),		/* SCK */
5354c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
5364c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5374c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5384c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "i2c1")),		/* SDA */
5394c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
5404c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5414c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5424c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi0"),		/* CS */
5434c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart3")),	/* TX */
5444c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
5454c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5464c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5474c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi0"),		/* CLK */
5484c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart3")),	/* RX */
5494c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
5504c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5514c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5524c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi0"),		/* DOUT */
5534c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart3")),	/* RTS */
5544c821d1cSChen-Yu Tsai 	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
5554c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x0, "gpio_in"),
5564c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x1, "gpio_out"),
5574c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x2, "spi0"),		/* DIN */
5584c821d1cSChen-Yu Tsai 		  SUNXI_FUNCTION(0x3, "uart3")),	/* CTS */
5594c821d1cSChen-Yu Tsai };
5604c821d1cSChen-Yu Tsai 
5614c821d1cSChen-Yu Tsai static const struct sunxi_pinctrl_desc sun8i_a23_pinctrl_data = {
5624c821d1cSChen-Yu Tsai 	.pins = sun8i_a23_pins,
5634c821d1cSChen-Yu Tsai 	.npins = ARRAY_SIZE(sun8i_a23_pins),
5644c821d1cSChen-Yu Tsai 	.irq_banks = 3,
565*cd70387fSMaxime Ripard 	.disable_strict_mode = true,
5664c821d1cSChen-Yu Tsai };
5674c821d1cSChen-Yu Tsai 
sun8i_a23_pinctrl_probe(struct platform_device * pdev)5684c821d1cSChen-Yu Tsai static int sun8i_a23_pinctrl_probe(struct platform_device *pdev)
5694c821d1cSChen-Yu Tsai {
5704c821d1cSChen-Yu Tsai 	return sunxi_pinctrl_init(pdev,
5714c821d1cSChen-Yu Tsai 				  &sun8i_a23_pinctrl_data);
5724c821d1cSChen-Yu Tsai }
5734c821d1cSChen-Yu Tsai 
574baa9946eSFabian Frederick static const struct of_device_id sun8i_a23_pinctrl_match[] = {
5754c821d1cSChen-Yu Tsai 	{ .compatible = "allwinner,sun8i-a23-pinctrl", },
5764c821d1cSChen-Yu Tsai 	{}
5774c821d1cSChen-Yu Tsai };
5784c821d1cSChen-Yu Tsai 
5794c821d1cSChen-Yu Tsai static struct platform_driver sun8i_a23_pinctrl_driver = {
5804c821d1cSChen-Yu Tsai 	.probe	= sun8i_a23_pinctrl_probe,
5814c821d1cSChen-Yu Tsai 	.driver	= {
5824c821d1cSChen-Yu Tsai 		.name		= "sun8i-a23-pinctrl",
5834c821d1cSChen-Yu Tsai 		.of_match_table	= sun8i_a23_pinctrl_match,
5844c821d1cSChen-Yu Tsai 	},
5854c821d1cSChen-Yu Tsai };
5860c8c6ba0SPaul Gortmaker builtin_platform_driver(sun8i_a23_pinctrl_driver);
587