xref: /linux/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c (revision 3d0fe49454652117522f60bfbefb978ba0e5300b)
1 // SPDX-License-Identifier: GPL-2.0+
2 //
3 // Copyright (C) 2016-2017 Socionext Inc.
4 //   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
5 
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <linux/mod_devicetable.h>
9 #include <linux/pinctrl/pinctrl.h>
10 #include <linux/platform_device.h>
11 
12 #include "pinctrl-uniphier.h"
13 
14 static const struct pinctrl_pin_desc uniphier_ld20_pins[] = {
15 	UNIPHIER_PINCTRL_PIN(0, "XECS1", UNIPHIER_PIN_IECTRL_EXIST,
16 			     0, UNIPHIER_PIN_DRV_3BIT,
17 			     0, UNIPHIER_PIN_PULL_UP),
18 	UNIPHIER_PINCTRL_PIN(1, "ERXW", UNIPHIER_PIN_IECTRL_EXIST,
19 			     1, UNIPHIER_PIN_DRV_3BIT,
20 			     1, UNIPHIER_PIN_PULL_UP),
21 	UNIPHIER_PINCTRL_PIN(2, "XERWE1", UNIPHIER_PIN_IECTRL_EXIST,
22 			     2, UNIPHIER_PIN_DRV_3BIT,
23 			     2, UNIPHIER_PIN_PULL_UP),
24 	UNIPHIER_PINCTRL_PIN(3, "XNFWP", UNIPHIER_PIN_IECTRL_EXIST,
25 			     3, UNIPHIER_PIN_DRV_3BIT,
26 			     3, UNIPHIER_PIN_PULL_DOWN),
27 	UNIPHIER_PINCTRL_PIN(4, "XNFCE0", UNIPHIER_PIN_IECTRL_EXIST,
28 			     4, UNIPHIER_PIN_DRV_3BIT,
29 			     4, UNIPHIER_PIN_PULL_UP),
30 	UNIPHIER_PINCTRL_PIN(5, "NFRYBY0", UNIPHIER_PIN_IECTRL_EXIST,
31 			     5, UNIPHIER_PIN_DRV_3BIT,
32 			     5, UNIPHIER_PIN_PULL_UP),
33 	UNIPHIER_PINCTRL_PIN(6, "XNFRE", UNIPHIER_PIN_IECTRL_EXIST,
34 			     6, UNIPHIER_PIN_DRV_3BIT,
35 			     6, UNIPHIER_PIN_PULL_UP),
36 	UNIPHIER_PINCTRL_PIN(7, "XNFWE", UNIPHIER_PIN_IECTRL_EXIST,
37 			     7, UNIPHIER_PIN_DRV_3BIT,
38 			     7, UNIPHIER_PIN_PULL_UP),
39 	UNIPHIER_PINCTRL_PIN(8, "NFALE", UNIPHIER_PIN_IECTRL_EXIST,
40 			     8, UNIPHIER_PIN_DRV_3BIT,
41 			     8, UNIPHIER_PIN_PULL_UP),
42 	UNIPHIER_PINCTRL_PIN(9, "NFCLE", UNIPHIER_PIN_IECTRL_EXIST,
43 			     9, UNIPHIER_PIN_DRV_3BIT,
44 			     9, UNIPHIER_PIN_PULL_UP),
45 	UNIPHIER_PINCTRL_PIN(10, "NFD0", UNIPHIER_PIN_IECTRL_EXIST,
46 			     10, UNIPHIER_PIN_DRV_3BIT,
47 			     10, UNIPHIER_PIN_PULL_UP),
48 	UNIPHIER_PINCTRL_PIN(11, "NFD1", UNIPHIER_PIN_IECTRL_EXIST,
49 			     11, UNIPHIER_PIN_DRV_3BIT,
50 			     11, UNIPHIER_PIN_PULL_UP),
51 	UNIPHIER_PINCTRL_PIN(12, "NFD2", UNIPHIER_PIN_IECTRL_EXIST,
52 			     12, UNIPHIER_PIN_DRV_3BIT,
53 			     12, UNIPHIER_PIN_PULL_UP),
54 	UNIPHIER_PINCTRL_PIN(13, "NFD3", UNIPHIER_PIN_IECTRL_EXIST,
55 			     13, UNIPHIER_PIN_DRV_3BIT,
56 			     13, UNIPHIER_PIN_PULL_UP),
57 	UNIPHIER_PINCTRL_PIN(14, "NFD4", UNIPHIER_PIN_IECTRL_EXIST,
58 			     14, UNIPHIER_PIN_DRV_3BIT,
59 			     14, UNIPHIER_PIN_PULL_UP),
60 	UNIPHIER_PINCTRL_PIN(15, "NFD5", UNIPHIER_PIN_IECTRL_EXIST,
61 			     15, UNIPHIER_PIN_DRV_3BIT,
62 			     15, UNIPHIER_PIN_PULL_UP),
63 	UNIPHIER_PINCTRL_PIN(16, "NFD6", UNIPHIER_PIN_IECTRL_EXIST,
64 			     16, UNIPHIER_PIN_DRV_3BIT,
65 			     16, UNIPHIER_PIN_PULL_UP),
66 	UNIPHIER_PINCTRL_PIN(17, "NFD7", UNIPHIER_PIN_IECTRL_EXIST,
67 			     17, UNIPHIER_PIN_DRV_3BIT,
68 			     17, UNIPHIER_PIN_PULL_UP),
69 	UNIPHIER_PINCTRL_PIN(18, "XERST", UNIPHIER_PIN_IECTRL_EXIST,
70 			     0, UNIPHIER_PIN_DRV_2BIT,
71 			     18, UNIPHIER_PIN_PULL_UP),
72 	UNIPHIER_PINCTRL_PIN(19, "MMCCLK", UNIPHIER_PIN_IECTRL_EXIST,
73 			     1, UNIPHIER_PIN_DRV_2BIT,
74 			     19, UNIPHIER_PIN_PULL_UP),
75 	UNIPHIER_PINCTRL_PIN(20, "MMCCMD", UNIPHIER_PIN_IECTRL_EXIST,
76 			     2, UNIPHIER_PIN_DRV_2BIT,
77 			     20, UNIPHIER_PIN_PULL_UP),
78 	UNIPHIER_PINCTRL_PIN(21, "MMCDS", UNIPHIER_PIN_IECTRL_EXIST,
79 			     3, UNIPHIER_PIN_DRV_2BIT,
80 			     21, UNIPHIER_PIN_PULL_UP),
81 	UNIPHIER_PINCTRL_PIN(22, "MMCDAT0", UNIPHIER_PIN_IECTRL_EXIST,
82 			     4, UNIPHIER_PIN_DRV_2BIT,
83 			     22, UNIPHIER_PIN_PULL_UP),
84 	UNIPHIER_PINCTRL_PIN(23, "MMCDAT1", UNIPHIER_PIN_IECTRL_EXIST,
85 			     5, UNIPHIER_PIN_DRV_2BIT,
86 			     23, UNIPHIER_PIN_PULL_UP),
87 	UNIPHIER_PINCTRL_PIN(24, "MMCDAT2", UNIPHIER_PIN_IECTRL_EXIST,
88 			     6, UNIPHIER_PIN_DRV_2BIT,
89 			     24, UNIPHIER_PIN_PULL_UP),
90 	UNIPHIER_PINCTRL_PIN(25, "MMCDAT3", UNIPHIER_PIN_IECTRL_EXIST,
91 			     7, UNIPHIER_PIN_DRV_2BIT,
92 			     25, UNIPHIER_PIN_PULL_UP),
93 	UNIPHIER_PINCTRL_PIN(26, "MMCDAT4", UNIPHIER_PIN_IECTRL_EXIST,
94 			     8, UNIPHIER_PIN_DRV_2BIT,
95 			     26, UNIPHIER_PIN_PULL_UP),
96 	UNIPHIER_PINCTRL_PIN(27, "MMCDAT5", UNIPHIER_PIN_IECTRL_EXIST,
97 			     9, UNIPHIER_PIN_DRV_2BIT,
98 			     27, UNIPHIER_PIN_PULL_UP),
99 	UNIPHIER_PINCTRL_PIN(28, "MMCDAT6", UNIPHIER_PIN_IECTRL_EXIST,
100 			     10, UNIPHIER_PIN_DRV_2BIT,
101 			     28, UNIPHIER_PIN_PULL_UP),
102 	UNIPHIER_PINCTRL_PIN(29, "MMCDAT7", UNIPHIER_PIN_IECTRL_EXIST,
103 			     11, UNIPHIER_PIN_DRV_2BIT,
104 			     29, UNIPHIER_PIN_PULL_UP),
105 	UNIPHIER_PINCTRL_PIN(30, "MDC", UNIPHIER_PIN_IECTRL_EXIST,
106 			     18, UNIPHIER_PIN_DRV_3BIT,
107 			     30, UNIPHIER_PIN_PULL_DOWN),
108 	UNIPHIER_PINCTRL_PIN(31, "MDIO", UNIPHIER_PIN_IECTRL_EXIST,
109 			     19, UNIPHIER_PIN_DRV_3BIT,
110 			     31, UNIPHIER_PIN_PULL_DOWN),
111 	UNIPHIER_PINCTRL_PIN(32, "MDIO_INTL", UNIPHIER_PIN_IECTRL_EXIST,
112 			     20, UNIPHIER_PIN_DRV_3BIT,
113 			     32, UNIPHIER_PIN_PULL_DOWN),
114 	UNIPHIER_PINCTRL_PIN(33, "PHYRSTL", UNIPHIER_PIN_IECTRL_EXIST,
115 			     21, UNIPHIER_PIN_DRV_3BIT,
116 			     33, UNIPHIER_PIN_PULL_DOWN),
117 	UNIPHIER_PINCTRL_PIN(34, "RGMII_RXCLK", UNIPHIER_PIN_IECTRL_EXIST,
118 			     22, UNIPHIER_PIN_DRV_3BIT,
119 			     34, UNIPHIER_PIN_PULL_DOWN),
120 	UNIPHIER_PINCTRL_PIN(35, "RGMII_RXD0", UNIPHIER_PIN_IECTRL_EXIST,
121 			     23, UNIPHIER_PIN_DRV_3BIT,
122 			     35, UNIPHIER_PIN_PULL_DOWN),
123 	UNIPHIER_PINCTRL_PIN(36, "RGMII_RXD1", UNIPHIER_PIN_IECTRL_EXIST,
124 			     24, UNIPHIER_PIN_DRV_3BIT,
125 			     36, UNIPHIER_PIN_PULL_DOWN),
126 	UNIPHIER_PINCTRL_PIN(37, "RGMII_RXD2", UNIPHIER_PIN_IECTRL_EXIST,
127 			     25, UNIPHIER_PIN_DRV_3BIT,
128 			     37, UNIPHIER_PIN_PULL_DOWN),
129 	UNIPHIER_PINCTRL_PIN(38, "RGMII_RXD3", UNIPHIER_PIN_IECTRL_EXIST,
130 			     26, UNIPHIER_PIN_DRV_3BIT,
131 			     38, UNIPHIER_PIN_PULL_DOWN),
132 	UNIPHIER_PINCTRL_PIN(39, "RGMII_RXCTL", UNIPHIER_PIN_IECTRL_EXIST,
133 			     27, UNIPHIER_PIN_DRV_3BIT,
134 			     39, UNIPHIER_PIN_PULL_DOWN),
135 	UNIPHIER_PINCTRL_PIN(40, "RGMII_TXCLK", UNIPHIER_PIN_IECTRL_EXIST,
136 			     28, UNIPHIER_PIN_DRV_3BIT,
137 			     40, UNIPHIER_PIN_PULL_DOWN),
138 	UNIPHIER_PINCTRL_PIN(41, "RGMII_TXD0", UNIPHIER_PIN_IECTRL_EXIST,
139 			     29, UNIPHIER_PIN_DRV_3BIT,
140 			     41, UNIPHIER_PIN_PULL_DOWN),
141 	UNIPHIER_PINCTRL_PIN(42, "RGMII_TXD1", UNIPHIER_PIN_IECTRL_EXIST,
142 			     30, UNIPHIER_PIN_DRV_3BIT,
143 			     42, UNIPHIER_PIN_PULL_DOWN),
144 	UNIPHIER_PINCTRL_PIN(43, "RGMII_TXD2", UNIPHIER_PIN_IECTRL_EXIST,
145 			     31, UNIPHIER_PIN_DRV_3BIT,
146 			     43, UNIPHIER_PIN_PULL_DOWN),
147 	UNIPHIER_PINCTRL_PIN(44, "RGMII_TXD3", UNIPHIER_PIN_IECTRL_EXIST,
148 			     32, UNIPHIER_PIN_DRV_3BIT,
149 			     44, UNIPHIER_PIN_PULL_DOWN),
150 	UNIPHIER_PINCTRL_PIN(45, "RGMII_TXCTL", UNIPHIER_PIN_IECTRL_EXIST,
151 			     33, UNIPHIER_PIN_DRV_3BIT,
152 			     45, UNIPHIER_PIN_PULL_DOWN),
153 	UNIPHIER_PINCTRL_PIN(46, "USB0VBUS", UNIPHIER_PIN_IECTRL_EXIST,
154 			     34, UNIPHIER_PIN_DRV_3BIT,
155 			     46, UNIPHIER_PIN_PULL_DOWN),
156 	UNIPHIER_PINCTRL_PIN(47, "USB0OD", UNIPHIER_PIN_IECTRL_EXIST,
157 			     35, UNIPHIER_PIN_DRV_3BIT,
158 			     47, UNIPHIER_PIN_PULL_UP),
159 	UNIPHIER_PINCTRL_PIN(48, "USB1VBUS", UNIPHIER_PIN_IECTRL_EXIST,
160 			     36, UNIPHIER_PIN_DRV_3BIT,
161 			     48, UNIPHIER_PIN_PULL_DOWN),
162 	UNIPHIER_PINCTRL_PIN(49, "USB1OD", UNIPHIER_PIN_IECTRL_EXIST,
163 			     37, UNIPHIER_PIN_DRV_3BIT,
164 			     49, UNIPHIER_PIN_PULL_UP),
165 	UNIPHIER_PINCTRL_PIN(50, "USB2VBUS", UNIPHIER_PIN_IECTRL_EXIST,
166 			     38, UNIPHIER_PIN_DRV_3BIT,
167 			     50, UNIPHIER_PIN_PULL_DOWN),
168 	UNIPHIER_PINCTRL_PIN(51, "USB2OD", UNIPHIER_PIN_IECTRL_EXIST,
169 			     39, UNIPHIER_PIN_DRV_3BIT,
170 			     51, UNIPHIER_PIN_PULL_UP),
171 	UNIPHIER_PINCTRL_PIN(52, "USB3VBUS", UNIPHIER_PIN_IECTRL_EXIST,
172 			     40, UNIPHIER_PIN_DRV_3BIT,
173 			     52, UNIPHIER_PIN_PULL_DOWN),
174 	UNIPHIER_PINCTRL_PIN(53, "USB3OD", UNIPHIER_PIN_IECTRL_EXIST,
175 			     41, UNIPHIER_PIN_DRV_3BIT,
176 			     53, UNIPHIER_PIN_PULL_UP),
177 	UNIPHIER_PINCTRL_PIN(54, "TXD0", UNIPHIER_PIN_IECTRL_EXIST,
178 			     42, UNIPHIER_PIN_DRV_3BIT,
179 			     54, UNIPHIER_PIN_PULL_UP),
180 	UNIPHIER_PINCTRL_PIN(55, "RXD0", UNIPHIER_PIN_IECTRL_EXIST,
181 			     43, UNIPHIER_PIN_DRV_3BIT,
182 			     55, UNIPHIER_PIN_PULL_UP),
183 	UNIPHIER_PINCTRL_PIN(56, "SPISYNC0", UNIPHIER_PIN_IECTRL_EXIST,
184 			     44, UNIPHIER_PIN_DRV_3BIT,
185 			     56, UNIPHIER_PIN_PULL_DOWN),
186 	UNIPHIER_PINCTRL_PIN(57, "SPISCLK0", UNIPHIER_PIN_IECTRL_EXIST,
187 			     45, UNIPHIER_PIN_DRV_3BIT,
188 			     57, UNIPHIER_PIN_PULL_DOWN),
189 	UNIPHIER_PINCTRL_PIN(58, "SPITXD0", UNIPHIER_PIN_IECTRL_EXIST,
190 			     46, UNIPHIER_PIN_DRV_3BIT,
191 			     58, UNIPHIER_PIN_PULL_DOWN),
192 	UNIPHIER_PINCTRL_PIN(59, "SPIRXD0", UNIPHIER_PIN_IECTRL_EXIST,
193 			     47, UNIPHIER_PIN_DRV_3BIT,
194 			     59, UNIPHIER_PIN_PULL_DOWN),
195 	UNIPHIER_PINCTRL_PIN(60, "AGCI", UNIPHIER_PIN_IECTRL_EXIST,
196 			     48, UNIPHIER_PIN_DRV_3BIT,
197 			     60, UNIPHIER_PIN_PULL_DOWN),
198 	UNIPHIER_PINCTRL_PIN(61, "DMDSDA0", UNIPHIER_PIN_IECTRL_EXIST,
199 			     -1, UNIPHIER_PIN_DRV_FIXED4,
200 			     -1, UNIPHIER_PIN_PULL_NONE),
201 	UNIPHIER_PINCTRL_PIN(62, "DMDSCL0", UNIPHIER_PIN_IECTRL_EXIST,
202 			     -1, UNIPHIER_PIN_DRV_FIXED4,
203 			     -1, UNIPHIER_PIN_PULL_NONE),
204 	UNIPHIER_PINCTRL_PIN(63, "SDA0", UNIPHIER_PIN_IECTRL_EXIST,
205 			     -1, UNIPHIER_PIN_DRV_FIXED4,
206 			     -1, UNIPHIER_PIN_PULL_NONE),
207 	UNIPHIER_PINCTRL_PIN(64, "SCL0", UNIPHIER_PIN_IECTRL_EXIST,
208 			     -1, UNIPHIER_PIN_DRV_FIXED4,
209 			     -1, UNIPHIER_PIN_PULL_NONE),
210 	UNIPHIER_PINCTRL_PIN(65, "SDA1", UNIPHIER_PIN_IECTRL_EXIST,
211 			     -1, UNIPHIER_PIN_DRV_FIXED4,
212 			     -1, UNIPHIER_PIN_PULL_NONE),
213 	UNIPHIER_PINCTRL_PIN(66, "SCL1", UNIPHIER_PIN_IECTRL_EXIST,
214 			     -1, UNIPHIER_PIN_DRV_FIXED4,
215 			     -1, UNIPHIER_PIN_PULL_NONE),
216 	UNIPHIER_PINCTRL_PIN(67, "HIN", UNIPHIER_PIN_IECTRL_EXIST,
217 			     -1, UNIPHIER_PIN_DRV_FIXED4,
218 			     -1, UNIPHIER_PIN_PULL_NONE),
219 	UNIPHIER_PINCTRL_PIN(68, "VIN", UNIPHIER_PIN_IECTRL_EXIST,
220 			     -1, UNIPHIER_PIN_DRV_FIXED4,
221 			     -1, UNIPHIER_PIN_PULL_NONE),
222 	UNIPHIER_PINCTRL_PIN(69, "PCA00", UNIPHIER_PIN_IECTRL_EXIST,
223 			     49, UNIPHIER_PIN_DRV_3BIT,
224 			     69, UNIPHIER_PIN_PULL_DOWN),
225 	UNIPHIER_PINCTRL_PIN(70, "PCA01", UNIPHIER_PIN_IECTRL_EXIST,
226 			     50, UNIPHIER_PIN_DRV_3BIT,
227 			     70, UNIPHIER_PIN_PULL_DOWN),
228 	UNIPHIER_PINCTRL_PIN(71, "PCA02", UNIPHIER_PIN_IECTRL_EXIST,
229 			     51, UNIPHIER_PIN_DRV_3BIT,
230 			     71, UNIPHIER_PIN_PULL_DOWN),
231 	UNIPHIER_PINCTRL_PIN(72, "PCA03", UNIPHIER_PIN_IECTRL_EXIST,
232 			     52, UNIPHIER_PIN_DRV_3BIT,
233 			     72, UNIPHIER_PIN_PULL_DOWN),
234 	UNIPHIER_PINCTRL_PIN(73, "PCA04", UNIPHIER_PIN_IECTRL_EXIST,
235 			     53, UNIPHIER_PIN_DRV_3BIT,
236 			     73, UNIPHIER_PIN_PULL_DOWN),
237 	UNIPHIER_PINCTRL_PIN(74, "PCA05", UNIPHIER_PIN_IECTRL_EXIST,
238 			     54, UNIPHIER_PIN_DRV_3BIT,
239 			     74, UNIPHIER_PIN_PULL_DOWN),
240 	UNIPHIER_PINCTRL_PIN(75, "PCA06", UNIPHIER_PIN_IECTRL_EXIST,
241 			     55, UNIPHIER_PIN_DRV_3BIT,
242 			     75, UNIPHIER_PIN_PULL_DOWN),
243 	UNIPHIER_PINCTRL_PIN(76, "PCA07", UNIPHIER_PIN_IECTRL_EXIST,
244 			     56, UNIPHIER_PIN_DRV_3BIT,
245 			     76, UNIPHIER_PIN_PULL_DOWN),
246 	UNIPHIER_PINCTRL_PIN(77, "PCA08", UNIPHIER_PIN_IECTRL_EXIST,
247 			     57, UNIPHIER_PIN_DRV_3BIT,
248 			     77, UNIPHIER_PIN_PULL_DOWN),
249 	UNIPHIER_PINCTRL_PIN(78, "PCA09", UNIPHIER_PIN_IECTRL_EXIST,
250 			     58, UNIPHIER_PIN_DRV_3BIT,
251 			     78, UNIPHIER_PIN_PULL_DOWN),
252 	UNIPHIER_PINCTRL_PIN(79, "PCA10", UNIPHIER_PIN_IECTRL_EXIST,
253 			     59, UNIPHIER_PIN_DRV_3BIT,
254 			     79, UNIPHIER_PIN_PULL_DOWN),
255 	UNIPHIER_PINCTRL_PIN(80, "PCA11", UNIPHIER_PIN_IECTRL_EXIST,
256 			     60, UNIPHIER_PIN_DRV_3BIT,
257 			     80, UNIPHIER_PIN_PULL_DOWN),
258 	UNIPHIER_PINCTRL_PIN(81, "PCA12", UNIPHIER_PIN_IECTRL_EXIST,
259 			     61, UNIPHIER_PIN_DRV_3BIT,
260 			     81, UNIPHIER_PIN_PULL_DOWN),
261 	UNIPHIER_PINCTRL_PIN(82, "PCA13", UNIPHIER_PIN_IECTRL_EXIST,
262 			     62, UNIPHIER_PIN_DRV_3BIT,
263 			     82, UNIPHIER_PIN_PULL_DOWN),
264 	UNIPHIER_PINCTRL_PIN(83, "PCA14", UNIPHIER_PIN_IECTRL_EXIST,
265 			     63, UNIPHIER_PIN_DRV_3BIT,
266 			     83, UNIPHIER_PIN_PULL_DOWN),
267 	UNIPHIER_PINCTRL_PIN(84, "PC0READY", UNIPHIER_PIN_IECTRL_EXIST,
268 			     0, UNIPHIER_PIN_DRV_1BIT,
269 			     84, UNIPHIER_PIN_PULL_DOWN),
270 	UNIPHIER_PINCTRL_PIN(85, "PC0CD1", UNIPHIER_PIN_IECTRL_EXIST,
271 			     1, UNIPHIER_PIN_DRV_1BIT,
272 			     85, UNIPHIER_PIN_PULL_DOWN),
273 	UNIPHIER_PINCTRL_PIN(86, "PC0CD2", UNIPHIER_PIN_IECTRL_EXIST,
274 			     2, UNIPHIER_PIN_DRV_1BIT,
275 			     86, UNIPHIER_PIN_PULL_DOWN),
276 	UNIPHIER_PINCTRL_PIN(87, "PC0WAIT", UNIPHIER_PIN_IECTRL_EXIST,
277 			     3, UNIPHIER_PIN_DRV_1BIT,
278 			     87, UNIPHIER_PIN_PULL_DOWN),
279 	UNIPHIER_PINCTRL_PIN(88, "PC0RESET", UNIPHIER_PIN_IECTRL_EXIST,
280 			     4, UNIPHIER_PIN_DRV_1BIT,
281 			     88, UNIPHIER_PIN_PULL_DOWN),
282 	UNIPHIER_PINCTRL_PIN(89, "PC0CE1", UNIPHIER_PIN_IECTRL_EXIST,
283 			     5, UNIPHIER_PIN_DRV_1BIT,
284 			     89, UNIPHIER_PIN_PULL_DOWN),
285 	UNIPHIER_PINCTRL_PIN(90, "PC0WE", UNIPHIER_PIN_IECTRL_EXIST,
286 			     6, UNIPHIER_PIN_DRV_1BIT,
287 			     90, UNIPHIER_PIN_PULL_DOWN),
288 	UNIPHIER_PINCTRL_PIN(91, "PC0OE", UNIPHIER_PIN_IECTRL_EXIST,
289 			     7, UNIPHIER_PIN_DRV_1BIT,
290 			     91, UNIPHIER_PIN_PULL_DOWN),
291 	UNIPHIER_PINCTRL_PIN(92, "PC0IOWR", UNIPHIER_PIN_IECTRL_EXIST,
292 			     8, UNIPHIER_PIN_DRV_1BIT,
293 			     92, UNIPHIER_PIN_PULL_DOWN),
294 	UNIPHIER_PINCTRL_PIN(93, "PC0IORD", UNIPHIER_PIN_IECTRL_EXIST,
295 			     9, UNIPHIER_PIN_DRV_1BIT,
296 			     93, UNIPHIER_PIN_PULL_DOWN),
297 	UNIPHIER_PINCTRL_PIN(94, "PCD00", UNIPHIER_PIN_IECTRL_EXIST,
298 			     10, UNIPHIER_PIN_DRV_1BIT,
299 			     94, UNIPHIER_PIN_PULL_DOWN),
300 	UNIPHIER_PINCTRL_PIN(95, "PCD01", UNIPHIER_PIN_IECTRL_EXIST,
301 			     11, UNIPHIER_PIN_DRV_1BIT,
302 			     95, UNIPHIER_PIN_PULL_DOWN),
303 	UNIPHIER_PINCTRL_PIN(96, "PCD02", UNIPHIER_PIN_IECTRL_EXIST,
304 			     12, UNIPHIER_PIN_DRV_1BIT,
305 			     96, UNIPHIER_PIN_PULL_DOWN),
306 	UNIPHIER_PINCTRL_PIN(97, "PCD03", UNIPHIER_PIN_IECTRL_EXIST,
307 			     13, UNIPHIER_PIN_DRV_1BIT,
308 			     97, UNIPHIER_PIN_PULL_DOWN),
309 	UNIPHIER_PINCTRL_PIN(98, "PCD04", UNIPHIER_PIN_IECTRL_EXIST,
310 			     14, UNIPHIER_PIN_DRV_1BIT,
311 			     98, UNIPHIER_PIN_PULL_DOWN),
312 	UNIPHIER_PINCTRL_PIN(99, "PCD05", UNIPHIER_PIN_IECTRL_EXIST,
313 			     15, UNIPHIER_PIN_DRV_1BIT,
314 			     99, UNIPHIER_PIN_PULL_DOWN),
315 	UNIPHIER_PINCTRL_PIN(100, "PCD06", UNIPHIER_PIN_IECTRL_EXIST,
316 			     16, UNIPHIER_PIN_DRV_1BIT,
317 			     100, UNIPHIER_PIN_PULL_DOWN),
318 	UNIPHIER_PINCTRL_PIN(101, "PCD07", UNIPHIER_PIN_IECTRL_EXIST,
319 			     17, UNIPHIER_PIN_DRV_1BIT,
320 			     101, UNIPHIER_PIN_PULL_DOWN),
321 	UNIPHIER_PINCTRL_PIN(102, "HS0BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
322 			     18, UNIPHIER_PIN_DRV_1BIT,
323 			     102, UNIPHIER_PIN_PULL_DOWN),
324 	UNIPHIER_PINCTRL_PIN(103, "HS0SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
325 			     19, UNIPHIER_PIN_DRV_1BIT,
326 			     103, UNIPHIER_PIN_PULL_DOWN),
327 	UNIPHIER_PINCTRL_PIN(104, "HS0VALIN", UNIPHIER_PIN_IECTRL_EXIST,
328 			     20, UNIPHIER_PIN_DRV_1BIT,
329 			     104, UNIPHIER_PIN_PULL_DOWN),
330 	UNIPHIER_PINCTRL_PIN(105, "HS0DIN0", UNIPHIER_PIN_IECTRL_EXIST,
331 			     21, UNIPHIER_PIN_DRV_1BIT,
332 			     105, UNIPHIER_PIN_PULL_DOWN),
333 	UNIPHIER_PINCTRL_PIN(106, "HS0DIN1", UNIPHIER_PIN_IECTRL_EXIST,
334 			     22, UNIPHIER_PIN_DRV_1BIT,
335 			     106, UNIPHIER_PIN_PULL_DOWN),
336 	UNIPHIER_PINCTRL_PIN(107, "HS0DIN2", UNIPHIER_PIN_IECTRL_EXIST,
337 			     23, UNIPHIER_PIN_DRV_1BIT,
338 			     107, UNIPHIER_PIN_PULL_DOWN),
339 	UNIPHIER_PINCTRL_PIN(108, "HS0DIN3", UNIPHIER_PIN_IECTRL_EXIST,
340 			     24, UNIPHIER_PIN_DRV_1BIT,
341 			     108, UNIPHIER_PIN_PULL_DOWN),
342 	UNIPHIER_PINCTRL_PIN(109, "HS0DIN4", UNIPHIER_PIN_IECTRL_EXIST,
343 			     25, UNIPHIER_PIN_DRV_1BIT,
344 			     109, UNIPHIER_PIN_PULL_DOWN),
345 	UNIPHIER_PINCTRL_PIN(110, "HS0DIN5", UNIPHIER_PIN_IECTRL_EXIST,
346 			     26, UNIPHIER_PIN_DRV_1BIT,
347 			     110, UNIPHIER_PIN_PULL_DOWN),
348 	UNIPHIER_PINCTRL_PIN(111, "HS0DIN6", UNIPHIER_PIN_IECTRL_EXIST,
349 			     27, UNIPHIER_PIN_DRV_1BIT,
350 			     111, UNIPHIER_PIN_PULL_DOWN),
351 	UNIPHIER_PINCTRL_PIN(112, "HS0DIN7", UNIPHIER_PIN_IECTRL_EXIST,
352 			     28, UNIPHIER_PIN_DRV_1BIT,
353 			     112, UNIPHIER_PIN_PULL_DOWN),
354 	UNIPHIER_PINCTRL_PIN(113, "HS0BCLKOUT", UNIPHIER_PIN_IECTRL_EXIST,
355 			     64, UNIPHIER_PIN_DRV_3BIT,
356 			     113, UNIPHIER_PIN_PULL_DOWN),
357 	UNIPHIER_PINCTRL_PIN(114, "HS0SYNCOUT", UNIPHIER_PIN_IECTRL_EXIST,
358 			     65, UNIPHIER_PIN_DRV_3BIT,
359 			     114, UNIPHIER_PIN_PULL_DOWN),
360 	UNIPHIER_PINCTRL_PIN(115, "HS0VALOUT", UNIPHIER_PIN_IECTRL_EXIST,
361 			     66, UNIPHIER_PIN_DRV_3BIT,
362 			     115, UNIPHIER_PIN_PULL_DOWN),
363 	UNIPHIER_PINCTRL_PIN(116, "HS0DOUT0", UNIPHIER_PIN_IECTRL_EXIST,
364 			     67, UNIPHIER_PIN_DRV_3BIT,
365 			     116, UNIPHIER_PIN_PULL_DOWN),
366 	UNIPHIER_PINCTRL_PIN(117, "HS0DOUT1", UNIPHIER_PIN_IECTRL_EXIST,
367 			     68, UNIPHIER_PIN_DRV_3BIT,
368 			     117, UNIPHIER_PIN_PULL_DOWN),
369 	UNIPHIER_PINCTRL_PIN(118, "HS0DOUT2", UNIPHIER_PIN_IECTRL_EXIST,
370 			     69, UNIPHIER_PIN_DRV_3BIT,
371 			     118, UNIPHIER_PIN_PULL_DOWN),
372 	UNIPHIER_PINCTRL_PIN(119, "HS0DOUT3", UNIPHIER_PIN_IECTRL_EXIST,
373 			     70, UNIPHIER_PIN_DRV_3BIT,
374 			     119, UNIPHIER_PIN_PULL_DOWN),
375 	UNIPHIER_PINCTRL_PIN(120, "HS0DOUT4", UNIPHIER_PIN_IECTRL_EXIST,
376 			     71, UNIPHIER_PIN_DRV_3BIT,
377 			     120, UNIPHIER_PIN_PULL_DOWN),
378 	UNIPHIER_PINCTRL_PIN(121, "HS0DOUT5", UNIPHIER_PIN_IECTRL_EXIST,
379 			     72, UNIPHIER_PIN_DRV_3BIT,
380 			     121, UNIPHIER_PIN_PULL_DOWN),
381 	UNIPHIER_PINCTRL_PIN(122, "HS0DOUT6", UNIPHIER_PIN_IECTRL_EXIST,
382 			     73, UNIPHIER_PIN_DRV_3BIT,
383 			     122, UNIPHIER_PIN_PULL_DOWN),
384 	UNIPHIER_PINCTRL_PIN(123, "HS0DOUT7", UNIPHIER_PIN_IECTRL_EXIST,
385 			     74, UNIPHIER_PIN_DRV_3BIT,
386 			     123, UNIPHIER_PIN_PULL_DOWN),
387 	UNIPHIER_PINCTRL_PIN(124, "HS1BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
388 			     75, UNIPHIER_PIN_DRV_3BIT,
389 			     124, UNIPHIER_PIN_PULL_DOWN),
390 	UNIPHIER_PINCTRL_PIN(125, "HS1SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
391 			     76, UNIPHIER_PIN_DRV_3BIT,
392 			     125, UNIPHIER_PIN_PULL_DOWN),
393 	UNIPHIER_PINCTRL_PIN(126, "HS1VALIN", UNIPHIER_PIN_IECTRL_EXIST,
394 			     77, UNIPHIER_PIN_DRV_3BIT,
395 			     126, UNIPHIER_PIN_PULL_DOWN),
396 	UNIPHIER_PINCTRL_PIN(127, "HS1DIN0", UNIPHIER_PIN_IECTRL_EXIST,
397 			     78, UNIPHIER_PIN_DRV_3BIT,
398 			     127, UNIPHIER_PIN_PULL_DOWN),
399 	UNIPHIER_PINCTRL_PIN(128, "HS1DIN1", UNIPHIER_PIN_IECTRL_EXIST,
400 			     79, UNIPHIER_PIN_DRV_3BIT,
401 			     128, UNIPHIER_PIN_PULL_DOWN),
402 	UNIPHIER_PINCTRL_PIN(129, "HS1DIN2", UNIPHIER_PIN_IECTRL_EXIST,
403 			     80, UNIPHIER_PIN_DRV_3BIT,
404 			     129, UNIPHIER_PIN_PULL_DOWN),
405 	UNIPHIER_PINCTRL_PIN(130, "HS1DIN3", UNIPHIER_PIN_IECTRL_EXIST,
406 			     81, UNIPHIER_PIN_DRV_3BIT,
407 			     130, UNIPHIER_PIN_PULL_DOWN),
408 	UNIPHIER_PINCTRL_PIN(131, "HS1DIN4", UNIPHIER_PIN_IECTRL_EXIST,
409 			     82, UNIPHIER_PIN_DRV_3BIT,
410 			     131, UNIPHIER_PIN_PULL_DOWN),
411 	UNIPHIER_PINCTRL_PIN(132, "HS1DIN5", UNIPHIER_PIN_IECTRL_EXIST,
412 			     83, UNIPHIER_PIN_DRV_3BIT,
413 			     132, UNIPHIER_PIN_PULL_DOWN),
414 	UNIPHIER_PINCTRL_PIN(133, "HS1DIN6", UNIPHIER_PIN_IECTRL_EXIST,
415 			     84, UNIPHIER_PIN_DRV_3BIT,
416 			     133, UNIPHIER_PIN_PULL_DOWN),
417 	UNIPHIER_PINCTRL_PIN(134, "HS1DIN7", UNIPHIER_PIN_IECTRL_EXIST,
418 			     85, UNIPHIER_PIN_DRV_3BIT,
419 			     134, UNIPHIER_PIN_PULL_DOWN),
420 	UNIPHIER_PINCTRL_PIN(135, "AO1IEC", UNIPHIER_PIN_IECTRL_EXIST,
421 			     86, UNIPHIER_PIN_DRV_3BIT,
422 			     135, UNIPHIER_PIN_PULL_DOWN),
423 	UNIPHIER_PINCTRL_PIN(136, "AO1ARC", UNIPHIER_PIN_IECTRL_EXIST,
424 			     87, UNIPHIER_PIN_DRV_3BIT,
425 			     136, UNIPHIER_PIN_PULL_DOWN),
426 	UNIPHIER_PINCTRL_PIN(137, "AO1DACCK", UNIPHIER_PIN_IECTRL_EXIST,
427 			     88, UNIPHIER_PIN_DRV_3BIT,
428 			     137, UNIPHIER_PIN_PULL_DOWN),
429 	UNIPHIER_PINCTRL_PIN(138, "AO1BCK", UNIPHIER_PIN_IECTRL_EXIST,
430 			     89, UNIPHIER_PIN_DRV_3BIT,
431 			     138, UNIPHIER_PIN_PULL_DOWN),
432 	UNIPHIER_PINCTRL_PIN(139, "AO1LRCK", UNIPHIER_PIN_IECTRL_EXIST,
433 			     90, UNIPHIER_PIN_DRV_3BIT,
434 			     139, UNIPHIER_PIN_PULL_DOWN),
435 	UNIPHIER_PINCTRL_PIN(140, "AO1D0", UNIPHIER_PIN_IECTRL_EXIST,
436 			     91, UNIPHIER_PIN_DRV_3BIT,
437 			     140, UNIPHIER_PIN_PULL_DOWN),
438 	UNIPHIER_PINCTRL_PIN(141, "AO1D1", UNIPHIER_PIN_IECTRL_EXIST,
439 			     92, UNIPHIER_PIN_DRV_3BIT,
440 			     141, UNIPHIER_PIN_PULL_DOWN),
441 	UNIPHIER_PINCTRL_PIN(142, "AO1D2", UNIPHIER_PIN_IECTRL_EXIST,
442 			     93, UNIPHIER_PIN_DRV_3BIT,
443 			     142, UNIPHIER_PIN_PULL_DOWN),
444 	UNIPHIER_PINCTRL_PIN(143, "HTPDN0", UNIPHIER_PIN_IECTRL_EXIST,
445 			     94, UNIPHIER_PIN_DRV_3BIT,
446 			     143, UNIPHIER_PIN_PULL_DOWN),
447 	UNIPHIER_PINCTRL_PIN(144, "LOCKN0", UNIPHIER_PIN_IECTRL_EXIST,
448 			     95, UNIPHIER_PIN_DRV_3BIT,
449 			     144, UNIPHIER_PIN_PULL_DOWN),
450 	UNIPHIER_PINCTRL_PIN(145, "HTPDN1", UNIPHIER_PIN_IECTRL_EXIST,
451 			     96, UNIPHIER_PIN_DRV_3BIT,
452 			     145, UNIPHIER_PIN_PULL_DOWN),
453 	UNIPHIER_PINCTRL_PIN(146, "LOCKN1", UNIPHIER_PIN_IECTRL_EXIST,
454 			     97, UNIPHIER_PIN_DRV_3BIT,
455 			     146, UNIPHIER_PIN_PULL_DOWN),
456 	UNIPHIER_PINCTRL_PIN(147, "PWMA", UNIPHIER_PIN_IECTRL_EXIST,
457 			     98, UNIPHIER_PIN_DRV_3BIT,
458 			     147, UNIPHIER_PIN_PULL_DOWN),
459 	UNIPHIER_PINCTRL_PIN(148, "LR_GOUT", UNIPHIER_PIN_IECTRL_EXIST,
460 			     99, UNIPHIER_PIN_DRV_3BIT,
461 			     148, UNIPHIER_PIN_PULL_DOWN),
462 	UNIPHIER_PINCTRL_PIN(149, "XIRQ0", UNIPHIER_PIN_IECTRL_EXIST,
463 			     100, UNIPHIER_PIN_DRV_3BIT,
464 			     149, UNIPHIER_PIN_PULL_DOWN),
465 	UNIPHIER_PINCTRL_PIN(150, "XIRQ1", UNIPHIER_PIN_IECTRL_EXIST,
466 			     101, UNIPHIER_PIN_DRV_3BIT,
467 			     150, UNIPHIER_PIN_PULL_DOWN),
468 	UNIPHIER_PINCTRL_PIN(151, "XIRQ2", UNIPHIER_PIN_IECTRL_EXIST,
469 			     102, UNIPHIER_PIN_DRV_3BIT,
470 			     151, UNIPHIER_PIN_PULL_DOWN),
471 	UNIPHIER_PINCTRL_PIN(152, "XIRQ3", UNIPHIER_PIN_IECTRL_EXIST,
472 			     103, UNIPHIER_PIN_DRV_3BIT,
473 			     152, UNIPHIER_PIN_PULL_DOWN),
474 	UNIPHIER_PINCTRL_PIN(153, "XIRQ4", UNIPHIER_PIN_IECTRL_EXIST,
475 			     104, UNIPHIER_PIN_DRV_3BIT,
476 			     153, UNIPHIER_PIN_PULL_DOWN),
477 	UNIPHIER_PINCTRL_PIN(154, "XIRQ5", UNIPHIER_PIN_IECTRL_EXIST,
478 			     105, UNIPHIER_PIN_DRV_3BIT,
479 			     154, UNIPHIER_PIN_PULL_DOWN),
480 	UNIPHIER_PINCTRL_PIN(155, "XIRQ6", UNIPHIER_PIN_IECTRL_EXIST,
481 			     106, UNIPHIER_PIN_DRV_3BIT,
482 			     155, UNIPHIER_PIN_PULL_DOWN),
483 	UNIPHIER_PINCTRL_PIN(156, "XIRQ7", UNIPHIER_PIN_IECTRL_EXIST,
484 			     107, UNIPHIER_PIN_DRV_3BIT,
485 			     156, UNIPHIER_PIN_PULL_DOWN),
486 	UNIPHIER_PINCTRL_PIN(157, "XIRQ8", UNIPHIER_PIN_IECTRL_EXIST,
487 			     108, UNIPHIER_PIN_DRV_3BIT,
488 			     157, UNIPHIER_PIN_PULL_DOWN),
489 	UNIPHIER_PINCTRL_PIN(158, "XIRQ9", UNIPHIER_PIN_IECTRL_EXIST,
490 			     109, UNIPHIER_PIN_DRV_3BIT,
491 			     158, UNIPHIER_PIN_PULL_DOWN),
492 	UNIPHIER_PINCTRL_PIN(159, "XIRQ10", UNIPHIER_PIN_IECTRL_EXIST,
493 			     110, UNIPHIER_PIN_DRV_3BIT,
494 			     159, UNIPHIER_PIN_PULL_DOWN),
495 	UNIPHIER_PINCTRL_PIN(160, "XIRQ11", UNIPHIER_PIN_IECTRL_EXIST,
496 			     111, UNIPHIER_PIN_DRV_3BIT,
497 			     160, UNIPHIER_PIN_PULL_DOWN),
498 	UNIPHIER_PINCTRL_PIN(161, "XIRQ13", UNIPHIER_PIN_IECTRL_EXIST,
499 			     112, UNIPHIER_PIN_DRV_3BIT,
500 			     161, UNIPHIER_PIN_PULL_DOWN),
501 	UNIPHIER_PINCTRL_PIN(162, "XIRQ14", UNIPHIER_PIN_IECTRL_EXIST,
502 			     113, UNIPHIER_PIN_DRV_3BIT,
503 			     162, UNIPHIER_PIN_PULL_DOWN),
504 	UNIPHIER_PINCTRL_PIN(163, "XIRQ16", UNIPHIER_PIN_IECTRL_EXIST,
505 			     114, UNIPHIER_PIN_DRV_3BIT,
506 			     163, UNIPHIER_PIN_PULL_DOWN),
507 	UNIPHIER_PINCTRL_PIN(164, "XIRQ17", UNIPHIER_PIN_IECTRL_EXIST,
508 			     115, UNIPHIER_PIN_DRV_3BIT,
509 			     164, UNIPHIER_PIN_PULL_DOWN),
510 	UNIPHIER_PINCTRL_PIN(165, "XIRQ18", UNIPHIER_PIN_IECTRL_EXIST,
511 			     116, UNIPHIER_PIN_DRV_3BIT,
512 			     165, UNIPHIER_PIN_PULL_DOWN),
513 	UNIPHIER_PINCTRL_PIN(166, "XIRQ19", UNIPHIER_PIN_IECTRL_EXIST,
514 			     117, UNIPHIER_PIN_DRV_3BIT,
515 			     166, UNIPHIER_PIN_PULL_DOWN),
516 	UNIPHIER_PINCTRL_PIN(167, "XIRQ20", UNIPHIER_PIN_IECTRL_EXIST,
517 			     118, UNIPHIER_PIN_DRV_3BIT,
518 			     167, UNIPHIER_PIN_PULL_DOWN),
519 	UNIPHIER_PINCTRL_PIN(168, "PORT00", UNIPHIER_PIN_IECTRL_EXIST,
520 			     119, UNIPHIER_PIN_DRV_3BIT,
521 			     168, UNIPHIER_PIN_PULL_DOWN),
522 	UNIPHIER_PINCTRL_PIN(169, "PORT01", UNIPHIER_PIN_IECTRL_EXIST,
523 			     120, UNIPHIER_PIN_DRV_3BIT,
524 			     169, UNIPHIER_PIN_PULL_DOWN),
525 	UNIPHIER_PINCTRL_PIN(170, "PORT02", UNIPHIER_PIN_IECTRL_EXIST,
526 			     121, UNIPHIER_PIN_DRV_3BIT,
527 			     170, UNIPHIER_PIN_PULL_DOWN),
528 	UNIPHIER_PINCTRL_PIN(171, "PORT03", UNIPHIER_PIN_IECTRL_EXIST,
529 			     122, UNIPHIER_PIN_DRV_3BIT,
530 			     171, UNIPHIER_PIN_PULL_DOWN),
531 	UNIPHIER_PINCTRL_PIN(172, "PORT04", UNIPHIER_PIN_IECTRL_EXIST,
532 			     123, UNIPHIER_PIN_DRV_3BIT,
533 			     172, UNIPHIER_PIN_PULL_DOWN),
534 	UNIPHIER_PINCTRL_PIN(173, "CK27FO", UNIPHIER_PIN_IECTRL_EXIST,
535 			     124, UNIPHIER_PIN_DRV_3BIT,
536 			     173, UNIPHIER_PIN_PULL_DOWN),
537 	UNIPHIER_PINCTRL_PIN(174, "PHSYNCO", UNIPHIER_PIN_IECTRL_EXIST,
538 			     125, UNIPHIER_PIN_DRV_3BIT,
539 			     174, UNIPHIER_PIN_PULL_DOWN),
540 	UNIPHIER_PINCTRL_PIN(175, "PVSYNCO", UNIPHIER_PIN_IECTRL_EXIST,
541 			     126, UNIPHIER_PIN_DRV_3BIT,
542 			     175, UNIPHIER_PIN_PULL_DOWN),
543 };
544 
545 static const unsigned ain1_pins[] = {150, 151, 152, 153};
546 static const int ain1_muxvals[] = {4, 4, 4, 4};
547 static const unsigned ain1_dat2_pins[] = {154};
548 static const int ain1_dat2_muxvals[] = {4};
549 static const unsigned ain1_dat4_pins[] = {155, 156};
550 static const int ain1_dat4_muxvals[] = {4, 4};
551 static const unsigned ain2_pins[] = {116, 117, 118, 119};
552 static const int ain2_muxvals[] = {26, 26, 26, 26};
553 static const unsigned ain2_dat2_pins[] = {120};
554 static const int ain2_dat2_muxvals[] = {26};
555 static const unsigned ain2_dat4_pins[] = {121, 122};
556 static const int ain2_dat4_muxvals[] = {26, 26};
557 static const unsigned ain3_pins[] = {116, 117, 118, 119};
558 static const int ain3_muxvals[] = {27, 27, 27, 27};
559 static const unsigned aout1_pins[] = {137, 138, 139, 140};
560 static const int aout1_muxvals[] = {0, 0, 0, 0};
561 static const unsigned aout1_dat2_pins[] = {141};
562 static const int aout1_dat2_muxvals[] = {0};
563 static const unsigned aout1_dat4_pins[] = {142, 156};
564 static const int aout1_dat4_muxvals[] = {0, 1};
565 static const unsigned aout1b_pins[] = {150, 151, 152, 153};
566 static const int aout1b_muxvals[] = {1, 1, 1, 1};
567 static const unsigned aout1b_dat2_pins[] = {154};
568 static const int aout1b_dat2_muxvals[] = {1};
569 static const unsigned aout1b_dat4_pins[] = {155, 156};
570 static const int aout1b_dat4_muxvals[] = {1, 1};
571 static const unsigned aout2_pins[] = {165, 157, 162, 158};
572 static const int aout2_muxvals[] = {2, 2, 2, 1};
573 static const unsigned aout2_dat2_pins[] = {159};
574 static const int aout2_dat2_muxvals[] = {1};
575 static const unsigned aout2_dat4_pins[] = {160, 161};
576 static const int aout2_dat4_muxvals[] = {1, 1};
577 static const unsigned aout3_pins[] = {166, 167, 168, 163};
578 static const int aout3_muxvals[] = {2, 2, 2, 1};
579 static const unsigned aout4_pins[] = {169, 170, 171, 164};
580 static const int aout4_muxvals[] = {2, 2, 2, 1};
581 static const unsigned aoutiec1_pins[] = {135, 136};
582 static const int aoutiec1_muxvals[] = {0, 0};
583 static const unsigned aoutiec2_pins[] = {135, 136};
584 static const int aoutiec2_muxvals[] = {1, 1};
585 static const unsigned int emmc_pins[] = {19, 20, 21, 22, 23, 24, 25};
586 static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0};
587 static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29};
588 static const int emmc_dat8_muxvals[] = {0, 0, 0, 0};
589 static const unsigned ether_rgmii_pins[] = {30, 31, 32, 33, 34, 35, 36, 37, 38,
590 					    39, 40, 41, 42, 43, 44, 45};
591 static const int ether_rgmii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
592 					  0, 0, 0, 0};
593 static const unsigned ether_rmii_pins[] = {30, 31, 32, 33, 34, 35, 36, 37, 39,
594 					   41, 42, 45};
595 static const int ether_rmii_muxvals[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
596 static const unsigned hscin0_ci_pins[] = {102, 103, 104, 105, 106, 107, 108,
597 					  109, 110, 111, 112};
598 static const int hscin0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
599 static const unsigned hscin0_p_pins[] = {102, 103, 104, 105, 106, 107, 108, 109,
600 					 110, 111, 112};
601 static const int hscin0_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
602 static const unsigned hscin0_s_pins[] = {116, 117, 118, 119};
603 static const int hscin0_s_muxvals[] = {3, 3, 3, 3};
604 static const unsigned hscin1_p_pins[] = {124, 125, 126, 127, 128, 129, 130, 131,
605 					 132, 133, 134};
606 static const int hscin1_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
607 static const unsigned hscin1_s_pins[] = {120, 121, 122, 123};
608 static const int hscin1_s_muxvals[] = {3, 3, 3, 3};
609 static const unsigned hscin2_s_pins[] = {124, 125, 126, 127};
610 static const int hscin2_s_muxvals[] = {3, 3, 3, 3};
611 static const unsigned hscin3_s_pins[] = {129, 130, 131, 132};
612 static const int hscin3_s_muxvals[] = {3, 3, 3, 3};
613 static const unsigned hscin4_s_pins[] = {80, 81, 82, 83};
614 static const int hscin4_s_muxvals[] = {3, 3, 3, 3};
615 static const unsigned hscout0_ci_pins[] = {113, 114, 115, 116, 117, 118, 119,
616 					   120, 121, 122, 123};
617 static const int hscout0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
618 static const unsigned hscout0_p_pins[] = {113, 114, 115, 116, 117, 118, 119,
619 					  120, 121, 122, 123};
620 static const int hscout0_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
621 static const unsigned hscout0_s_pins[] = {116, 117, 118, 119};
622 static const int hscout0_s_muxvals[] = {4, 4, 4, 4};
623 static const unsigned hscout1_s_pins[] = {120, 121, 122, 123};
624 static const int hscout1_s_muxvals[] = {4, 4, 4, 4};
625 static const unsigned i2c0_pins[] = {63, 64};
626 static const int i2c0_muxvals[] = {0, 0};
627 static const unsigned i2c1_pins[] = {65, 66};
628 static const int i2c1_muxvals[] = {0, 0};
629 static const unsigned i2c3_pins[] = {67, 68};
630 static const int i2c3_muxvals[] = {1, 1};
631 static const unsigned i2c4_pins[] = {61, 62};
632 static const int i2c4_muxvals[] = {1, 1};
633 static const unsigned nand_pins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
634 				     15, 16, 17};
635 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
636 static const unsigned sd_pins[] = {10, 11, 12, 13, 14, 15, 16, 17};
637 static const int sd_muxvals[] = {3, 3, 3, 3, 3, 3, 3, 3};  /* No SDVOLC */
638 static const unsigned spi0_pins[] = {56, 57, 58, 59};
639 static const int spi0_muxvals[] = {0, 0, 0, 0};
640 static const unsigned spi1_pins[] = {169, 170, 171, 172};
641 static const int spi1_muxvals[] = {1, 1, 1, 1};
642 static const unsigned spi2_pins[] = {86, 87, 88, 89};
643 static const int spi2_muxvals[] = {1, 1, 1, 1};
644 static const unsigned spi3_pins[] = {74, 75, 76, 77};
645 static const int spi3_muxvals[] = {1, 1, 1, 1};
646 static const unsigned system_bus_pins[] = {1, 2, 6, 7, 8, 9, 10, 11, 12, 13,
647 					   14, 15, 16, 17};
648 static const int system_bus_muxvals[] = {0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 					 2};
650 static const unsigned system_bus_cs1_pins[] = {0};
651 static const int system_bus_cs1_muxvals[] = {0};
652 static const unsigned uart0_pins[] = {54, 55};
653 static const int uart0_muxvals[] = {0, 0};
654 static const unsigned uart1_pins[] = {58, 59};
655 static const int uart1_muxvals[] = {1, 1};
656 static const unsigned uart2_pins[] = {90, 91};
657 static const int uart2_muxvals[] = {1, 1};
658 static const unsigned uart3_pins[] = {94, 95};
659 static const int uart3_muxvals[] = {1, 1};
660 static const unsigned uart3_ctsrts_pins[] = {96, 98};
661 static const int uart3_ctsrts_muxvals[] = {1, 1};
662 static const unsigned uart3_modem_pins[] = {97, 99, 100, 101};
663 static const int uart3_modem_muxvals[] = {1, 1, 1, 1};
664 static const unsigned usb0_pins[] = {46, 47};
665 static const int usb0_muxvals[] = {0, 0};
666 static const unsigned usb1_pins[] = {48, 49};
667 static const int usb1_muxvals[] = {0, 0};
668 static const unsigned usb2_pins[] = {50, 51};
669 static const int usb2_muxvals[] = {0, 0};
670 static const unsigned usb3_pins[] = {52, 53};
671 static const int usb3_muxvals[] = {0, 0};
672 static const unsigned int gpio_range0_pins[] = {
673 	168, 169, 170, 171, 172, 173, 174, 175,		/* PORT0x */
674 	0, 1, 2, 3, 4, 5, 6, 7,				/* PORT1x */
675 	8, 9, 10, 11, 12, 13, 14, 15,			/* PORT2x */
676 	16, 17, 18, 30, 31, 32, 33, 34,			/* PORT3x */
677 	35, 36, 37, 38, 39, 40, 41, 42,			/* PORT4x */
678 	43, 44, 45, 46, 47, 48, 49, 50,			/* PORT5x */
679 	51, 52, 53, 54, 55, 56, 57, 58,			/* PORT6x */
680 	59, 60, 69, 70, 71, 72, 73, 74,			/* PORT7x */
681 	75, 76, 77, 78, 79, 80, 81, 82,			/* PORT8x */
682 	83, 84, 85, 86, 87, 88, 89, 90,			/* PORT9x */
683 	91, 92, 93, 94, 95, 96, 97, 98,			/* PORT10x */
684 };
685 static const unsigned int gpio_range1_pins[] = {
686 	99, 100, 101, 102, 103, 104, 105, 106,		/* PORT12x */
687 	107, 108, 109, 110, 111, 112, 113, 114,		/* PORT13x */
688 	115, 116, 117, 118, 119, 120, 121, 122,		/* PORT14x */
689 	149, 150, 151, 152, 153, 154, 155, 156,		/* XIRQ0-7 */
690 	157, 158, 159, 160, 85, 161, 162, 84,		/* XIRQ8-15 */
691 	163, 164, 165, 166, 167, 146, 52, 53,		/* XIRQ16-23 */
692 	61, 62, 63, 64, 65, 66, 67, 68,			/* PORT18x */
693 };
694 static const unsigned int gpio_range2_pins[] = {
695 	123, 124, 125, 126, 127, 128, 129, 130,		/* PORT20x */
696 	131, 132, 133, 134, 135, 136, 137, 138,		/* PORT21x */
697 	139, 140, 141, 142, 143, 144, 145, 146,		/* PORT22x */
698 	147, 148, 149, 150, 151, 152, 153, 154,		/* PORT23x */
699 	155, 156, 157, 158, 159, 160, 161, 162,		/* PORT24x */
700 	163, 164, 165, 166, 167,			/* PORT250-254 */
701 };
702 
703 static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
704 	UNIPHIER_PINCTRL_GROUP(ain1),
705 	UNIPHIER_PINCTRL_GROUP(ain1_dat2),
706 	UNIPHIER_PINCTRL_GROUP(ain1_dat4),
707 	UNIPHIER_PINCTRL_GROUP(ain2),
708 	UNIPHIER_PINCTRL_GROUP(ain2_dat2),
709 	UNIPHIER_PINCTRL_GROUP(ain2_dat4),
710 	UNIPHIER_PINCTRL_GROUP(ain3),
711 	UNIPHIER_PINCTRL_GROUP(aout1),
712 	UNIPHIER_PINCTRL_GROUP(aout1_dat2),
713 	UNIPHIER_PINCTRL_GROUP(aout1_dat4),
714 	UNIPHIER_PINCTRL_GROUP(aout1b),
715 	UNIPHIER_PINCTRL_GROUP(aout1b_dat2),
716 	UNIPHIER_PINCTRL_GROUP(aout1b_dat4),
717 	UNIPHIER_PINCTRL_GROUP(aout2),
718 	UNIPHIER_PINCTRL_GROUP(aout2_dat2),
719 	UNIPHIER_PINCTRL_GROUP(aout2_dat4),
720 	UNIPHIER_PINCTRL_GROUP(aout3),
721 	UNIPHIER_PINCTRL_GROUP(aout4),
722 	UNIPHIER_PINCTRL_GROUP(aoutiec1),
723 	UNIPHIER_PINCTRL_GROUP(aoutiec2),
724 	UNIPHIER_PINCTRL_GROUP(emmc),
725 	UNIPHIER_PINCTRL_GROUP(emmc_dat8),
726 	UNIPHIER_PINCTRL_GROUP(ether_rgmii),
727 	UNIPHIER_PINCTRL_GROUP(ether_rmii),
728 	UNIPHIER_PINCTRL_GROUP(hscin0_ci),
729 	UNIPHIER_PINCTRL_GROUP(hscin0_p),
730 	UNIPHIER_PINCTRL_GROUP(hscin0_s),
731 	UNIPHIER_PINCTRL_GROUP(hscin1_p),
732 	UNIPHIER_PINCTRL_GROUP(hscin1_s),
733 	UNIPHIER_PINCTRL_GROUP(hscin2_s),
734 	UNIPHIER_PINCTRL_GROUP(hscin3_s),
735 	UNIPHIER_PINCTRL_GROUP(hscin4_s),
736 	UNIPHIER_PINCTRL_GROUP(hscout0_ci),
737 	UNIPHIER_PINCTRL_GROUP(hscout0_p),
738 	UNIPHIER_PINCTRL_GROUP(hscout0_s),
739 	UNIPHIER_PINCTRL_GROUP(hscout1_s),
740 	UNIPHIER_PINCTRL_GROUP(i2c0),
741 	UNIPHIER_PINCTRL_GROUP(i2c1),
742 	UNIPHIER_PINCTRL_GROUP(i2c3),
743 	UNIPHIER_PINCTRL_GROUP(i2c4),
744 	UNIPHIER_PINCTRL_GROUP(nand),
745 	UNIPHIER_PINCTRL_GROUP(sd),
746 	UNIPHIER_PINCTRL_GROUP(spi0),
747 	UNIPHIER_PINCTRL_GROUP(spi1),
748 	UNIPHIER_PINCTRL_GROUP(spi2),
749 	UNIPHIER_PINCTRL_GROUP(spi3),
750 	UNIPHIER_PINCTRL_GROUP(system_bus),
751 	UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
752 	UNIPHIER_PINCTRL_GROUP(uart0),
753 	UNIPHIER_PINCTRL_GROUP(uart1),
754 	UNIPHIER_PINCTRL_GROUP(uart2),
755 	UNIPHIER_PINCTRL_GROUP(uart3),
756 	UNIPHIER_PINCTRL_GROUP(uart3_ctsrts),
757 	UNIPHIER_PINCTRL_GROUP(uart3_modem),
758 	UNIPHIER_PINCTRL_GROUP(usb0),
759 	UNIPHIER_PINCTRL_GROUP(usb1),
760 	UNIPHIER_PINCTRL_GROUP(usb2),
761 	UNIPHIER_PINCTRL_GROUP(usb3),
762 	UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
763 	UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
764 	UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
765 };
766 
767 static const char * const ain1_groups[] = {"ain1", "ain1_dat2",
768 					   "ain1_dat4"};
769 static const char * const ain2_groups[] = {"ain2", "ain2_dat2",
770 					   "ain2_dat4"};
771 static const char * const ain3_groups[] = {"ain3"};
772 static const char * const aout1_groups[] = {"aout1", "aout1_dat2",
773 					    "aout1_dat4",
774 					    "aout1b", "aout1b_dat2",
775 					    "aout1b_dat4"};
776 static const char * const aout2_groups[] = {"aout2", "aout2_dat2",
777 					    "aout2_dat4"};
778 static const char * const aout3_groups[] = {"aout3"};
779 static const char * const aout4_groups[] = {"aout4"};
780 static const char * const aoutiec1_groups[] = {"aoutiec1"};
781 static const char * const aoutiec2_groups[] = {"aoutiec2"};
782 static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
783 static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
784 static const char * const ether_rmii_groups[] = {"ether_rmii"};
785 static const char * const hscin0_groups[] = {"hscin0_ci",
786 					     "hscin0_p",
787 					     "hscin0_s"};
788 static const char * const hscin1_groups[] = {"hscin1_p", "hscin1_s"};
789 static const char * const hscin2_groups[] = {"hscin2_s"};
790 static const char * const hscin3_groups[] = {"hscin3_s"};
791 static const char * const hscin4_groups[] = {"hscin4_s"};
792 static const char * const hscout0_groups[] = {"hscout0_ci",
793 					      "hscout0_p",
794 					      "hscout0_s"};
795 static const char * const hscout1_groups[] = {"hscout1_s"};
796 static const char * const i2c0_groups[] = {"i2c0"};
797 static const char * const i2c1_groups[] = {"i2c1"};
798 static const char * const i2c3_groups[] = {"i2c3"};
799 static const char * const i2c4_groups[] = {"i2c4"};
800 static const char * const nand_groups[] = {"nand"};
801 static const char * const sd_groups[] = {"sd"};
802 static const char * const spi0_groups[] = {"spi0"};
803 static const char * const spi1_groups[] = {"spi1"};
804 static const char * const spi2_groups[] = {"spi2"};
805 static const char * const spi3_groups[] = {"spi3"};
806 static const char * const system_bus_groups[] = {"system_bus",
807 						 "system_bus_cs1"};
808 static const char * const uart0_groups[] = {"uart0"};
809 static const char * const uart1_groups[] = {"uart1"};
810 static const char * const uart2_groups[] = {"uart2"};
811 static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts",
812 					    "uart3_modem"};
813 static const char * const usb0_groups[] = {"usb0"};
814 static const char * const usb1_groups[] = {"usb1"};
815 static const char * const usb2_groups[] = {"usb2"};
816 static const char * const usb3_groups[] = {"usb3"};
817 
818 static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
819 	UNIPHIER_PINMUX_FUNCTION(ain1),
820 	UNIPHIER_PINMUX_FUNCTION(ain2),
821 	UNIPHIER_PINMUX_FUNCTION(ain3),
822 	UNIPHIER_PINMUX_FUNCTION(aout1),
823 	UNIPHIER_PINMUX_FUNCTION(aout2),
824 	UNIPHIER_PINMUX_FUNCTION(aout3),
825 	UNIPHIER_PINMUX_FUNCTION(aout4),
826 	UNIPHIER_PINMUX_FUNCTION(aoutiec1),
827 	UNIPHIER_PINMUX_FUNCTION(aoutiec2),
828 	UNIPHIER_PINMUX_FUNCTION(emmc),
829 	UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
830 	UNIPHIER_PINMUX_FUNCTION(ether_rmii),
831 	UNIPHIER_PINMUX_FUNCTION(hscin0),
832 	UNIPHIER_PINMUX_FUNCTION(hscin1),
833 	UNIPHIER_PINMUX_FUNCTION(hscin2),
834 	UNIPHIER_PINMUX_FUNCTION(hscin3),
835 	UNIPHIER_PINMUX_FUNCTION(hscin4),
836 	UNIPHIER_PINMUX_FUNCTION(hscout0),
837 	UNIPHIER_PINMUX_FUNCTION(hscout1),
838 	UNIPHIER_PINMUX_FUNCTION(i2c0),
839 	UNIPHIER_PINMUX_FUNCTION(i2c1),
840 	UNIPHIER_PINMUX_FUNCTION(i2c3),
841 	UNIPHIER_PINMUX_FUNCTION(i2c4),
842 	UNIPHIER_PINMUX_FUNCTION(nand),
843 	UNIPHIER_PINMUX_FUNCTION(sd),
844 	UNIPHIER_PINMUX_FUNCTION(spi0),
845 	UNIPHIER_PINMUX_FUNCTION(spi1),
846 	UNIPHIER_PINMUX_FUNCTION(spi2),
847 	UNIPHIER_PINMUX_FUNCTION(spi3),
848 	UNIPHIER_PINMUX_FUNCTION(system_bus),
849 	UNIPHIER_PINMUX_FUNCTION(uart0),
850 	UNIPHIER_PINMUX_FUNCTION(uart1),
851 	UNIPHIER_PINMUX_FUNCTION(uart2),
852 	UNIPHIER_PINMUX_FUNCTION(uart3),
853 	UNIPHIER_PINMUX_FUNCTION(usb0),
854 	UNIPHIER_PINMUX_FUNCTION(usb1),
855 	UNIPHIER_PINMUX_FUNCTION(usb2),
856 	UNIPHIER_PINMUX_FUNCTION(usb3),
857 };
858 
859 static int uniphier_ld20_get_gpio_muxval(unsigned int pin,
860 					 unsigned int gpio_offset)
861 {
862 	if (gpio_offset == 132 || gpio_offset == 135)	/* XIRQ12, 15 */
863 		return 13;
864 
865 	if (gpio_offset >= 120 && gpio_offset <= 143)	/* XIRQx */
866 		return 14;
867 
868 	return 15;
869 }
870 
871 static const struct uniphier_pinctrl_socdata uniphier_ld20_pindata = {
872 	.pins = uniphier_ld20_pins,
873 	.npins = ARRAY_SIZE(uniphier_ld20_pins),
874 	.groups = uniphier_ld20_groups,
875 	.groups_count = ARRAY_SIZE(uniphier_ld20_groups),
876 	.functions = uniphier_ld20_functions,
877 	.functions_count = ARRAY_SIZE(uniphier_ld20_functions),
878 	.get_gpio_muxval = uniphier_ld20_get_gpio_muxval,
879 	.caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
880 };
881 
882 static int uniphier_ld20_pinctrl_probe(struct platform_device *pdev)
883 {
884 	return uniphier_pinctrl_probe(pdev, &uniphier_ld20_pindata);
885 }
886 
887 static const struct of_device_id uniphier_ld20_pinctrl_match[] = {
888 	{ .compatible = "socionext,uniphier-ld20-pinctrl" },
889 	{ /* sentinel */ }
890 };
891 
892 static struct platform_driver uniphier_ld20_pinctrl_driver = {
893 	.probe = uniphier_ld20_pinctrl_probe,
894 	.driver = {
895 		.name = "uniphier-ld20-pinctrl",
896 		.of_match_table = uniphier_ld20_pinctrl_match,
897 		.pm = &uniphier_pinctrl_pm_ops,
898 	},
899 };
900 builtin_platform_driver(uniphier_ld20_pinctrl_driver);
901