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