1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Marvell Berlin BG2Q pinctrl driver
4 *
5 * Copyright (C) 2014 Marvell Technology Group Ltd.
6 *
7 * Antoine Ténart <antoine.tenart@free-electrons.com>
8 */
9
10 #include <linux/init.h>
11 #include <linux/of.h>
12 #include <linux/platform_device.h>
13 #include <linux/property.h>
14 #include <linux/regmap.h>
15
16 #include "berlin.h"
17
18 static const struct berlin_desc_group berlin2q_soc_pinctrl_groups[] = {
19 /* G */
20 BERLIN_PINCTRL_GROUP("G0", 0x18, 0x3, 0x00,
21 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
22 BERLIN_PINCTRL_FUNCTION(0x1, "mmc"),
23 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
24 BERLIN_PINCTRL_GROUP("G1", 0x18, 0x3, 0x03,
25 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
26 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
27 BERLIN_PINCTRL_GROUP("G2", 0x18, 0x3, 0x06,
28 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
29 BERLIN_PINCTRL_FUNCTION(0x2, "arc"),
30 BERLIN_PINCTRL_FUNCTION(0x3, "lvds")),
31 BERLIN_PINCTRL_GROUP("G3", 0x18, 0x3, 0x09,
32 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
33 BERLIN_PINCTRL_FUNCTION(0x2, "i2s2"),
34 BERLIN_PINCTRL_FUNCTION(0x3, "lvds")),
35 BERLIN_PINCTRL_GROUP("G4", 0x18, 0x3, 0x0c,
36 BERLIN_PINCTRL_FUNCTION(0x0, "pll"),
37 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
38 BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
39 BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
40 BERLIN_PINCTRL_FUNCTION(0x5, "sata_dbg"),
41 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
42 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
43 BERLIN_PINCTRL_GROUP("G5", 0x18, 0x3, 0x0f,
44 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
45 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
46 BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
47 BERLIN_PINCTRL_FUNCTION(0x5, "sata_dbg"),
48 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
49 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
50 BERLIN_PINCTRL_GROUP("G6", 0x18, 0x3, 0x12,
51 BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
52 BERLIN_PINCTRL_FUNCTION(0x1, "twsi0"),
53 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
54 BERLIN_PINCTRL_GROUP("G7", 0x18, 0x3, 0x15,
55 BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
56 BERLIN_PINCTRL_FUNCTION(0x1, "twsi1"),
57 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
58 BERLIN_PINCTRL_FUNCTION(0x3, "eddc")),
59 BERLIN_PINCTRL_GROUP("G8", 0x18, 0x3, 0x18,
60 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* CLK/SDI/SDO */
61 BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
62 BERLIN_PINCTRL_GROUP("G9", 0x18, 0x3, 0x1b,
63 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n/SS1n */
64 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
65 BERLIN_PINCTRL_FUNCTION(0x5, "sata")),
66 BERLIN_PINCTRL_GROUP("G10", 0x1c, 0x3, 0x00,
67 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
68 BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS2n */
69 BERLIN_PINCTRL_FUNCTION(0x3, "i2s0"),
70 BERLIN_PINCTRL_FUNCTION(0x4, "pwm"),
71 BERLIN_PINCTRL_FUNCTION(0x5, "sata")),
72 BERLIN_PINCTRL_GROUP("G11", 0x1c, 0x3, 0x03,
73 BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
74 BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS3n */
75 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
76 BERLIN_PINCTRL_FUNCTION(0x3, "i2s1"),
77 BERLIN_PINCTRL_FUNCTION(0x4, "pwm"),
78 BERLIN_PINCTRL_FUNCTION(0x5, "sata")),
79 BERLIN_PINCTRL_GROUP("G12", 0x1c, 0x3, 0x06,
80 BERLIN_PINCTRL_FUNCTION(0x0, "agc"),
81 BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
82 BERLIN_PINCTRL_GROUP("G13", 0x1c, 0x3, 0x09,
83 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
84 BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
85 BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
86 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
87 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
88 BERLIN_PINCTRL_GROUP("G14", 0x1c, 0x3, 0x0c,
89 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
90 BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
91 BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
92 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
93 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
94 BERLIN_PINCTRL_GROUP("G15", 0x1c, 0x3, 0x0f,
95 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
96 BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
97 BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
98 BERLIN_PINCTRL_FUNCTION(0x5, "vdac"),
99 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
100 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
101 BERLIN_PINCTRL_GROUP("G16", 0x1c, 0x3, 0x12,
102 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
103 BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
104 BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
105 BERLIN_PINCTRL_FUNCTION(0x5, "osco"),
106 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
107 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
108 BERLIN_PINCTRL_GROUP("G17", 0x1c, 0x3, 0x15,
109 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
110 BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
111 BERLIN_PINCTRL_FUNCTION(0x3, "spdif"),
112 BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
113 BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
114 BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
115 BERLIN_PINCTRL_GROUP("G18", 0x1c, 0x3, 0x18,
116 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
117 BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
118 BERLIN_PINCTRL_FUNCTION(0x3, "i2s2"),
119 BERLIN_PINCTRL_FUNCTION(0x4, "sts1")),
120 BERLIN_PINCTRL_GROUP("G19", 0x1c, 0x3, 0x1b,
121 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
122 BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
123 BERLIN_PINCTRL_FUNCTION(0x3, "i2s3"),
124 BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
125 BERLIN_PINCTRL_FUNCTION(0x5, "osco")),
126 BERLIN_PINCTRL_GROUP("G20", 0x20, 0x3, 0x00,
127 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
128 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
129 BERLIN_PINCTRL_FUNCTION(0x3, "demod"),
130 /*
131 * Mode 0x4 mux usb2_dbg *and* usb3_dbg:
132 * add two functions so it can be used with other groups
133 * within the same subnode in the device tree
134 */
135 BERLIN_PINCTRL_FUNCTION(0x4, "usb2_dbg"),
136 BERLIN_PINCTRL_FUNCTION(0x4, "usb3_dbg")),
137 BERLIN_PINCTRL_GROUP("G21", 0x20, 0x3, 0x03,
138 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
139 BERLIN_PINCTRL_FUNCTION(0x1, "sts2"),
140 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
141 BERLIN_PINCTRL_FUNCTION(0x3, "demod")),
142 BERLIN_PINCTRL_GROUP("G22", 0x20, 0x3, 0x06,
143 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
144 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
145 BERLIN_PINCTRL_GROUP("G23", 0x20, 0x3, 0x09,
146 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
147 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
148 BERLIN_PINCTRL_FUNCTION(0x3, "avif"),
149 BERLIN_PINCTRL_FUNCTION(0x4, "usb2_dbg")),
150 BERLIN_PINCTRL_GROUP("G24", 0x20, 0x3, 0x0c,
151 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
152 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
153 BERLIN_PINCTRL_FUNCTION(0x3, "demod"),
154 BERLIN_PINCTRL_FUNCTION(0x4, "usb2_dbg")),
155 BERLIN_PINCTRL_GROUP("G25", 0x20, 0x3, 0x0f,
156 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
157 BERLIN_PINCTRL_FUNCTION(0x1, "vga"),
158 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
159 BERLIN_PINCTRL_FUNCTION(0x3, "avif"),
160 BERLIN_PINCTRL_FUNCTION(0x4, "usb2_dbg")),
161 BERLIN_PINCTRL_GROUP("G26", 0x20, 0x3, 0x12,
162 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
163 BERLIN_PINCTRL_FUNCTION(0x1, "lvds"),
164 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
165 BERLIN_PINCTRL_GROUP("G27", 0x20, 0x3, 0x15,
166 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
167 BERLIN_PINCTRL_FUNCTION(0x1, "agc"),
168 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
169 BERLIN_PINCTRL_GROUP("G28", 0x20, 0x3, 0x18,
170 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
171 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
172 BERLIN_PINCTRL_FUNCTION(0x3, "avif"),
173 BERLIN_PINCTRL_FUNCTION(0x4, "usb2_dbg")),
174 BERLIN_PINCTRL_GROUP("G29", 0x20, 0x3, 0x1b,
175 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
176 BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
177 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
178 BERLIN_PINCTRL_GROUP("G30", 0x24, 0x3, 0x00,
179 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
180 BERLIN_PINCTRL_FUNCTION(0x1, "scrd1"),
181 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
182 BERLIN_PINCTRL_GROUP("G31", 0x24, 0x3, 0x03,
183 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
184 BERLIN_PINCTRL_FUNCTION(0x1, "sd1"),
185 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
186 BERLIN_PINCTRL_GROUP("G32", 0x24, 0x3, 0x06,
187 BERLIN_PINCTRL_FUNCTION(0x0, "cam"),
188 BERLIN_PINCTRL_FUNCTION(0x1, "sd1"),
189 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
190 /* GAV */
191 BERLIN_PINCTRL_GROUP("GAV0", 0x24, 0x3, 0x09,
192 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
193 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
194 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
195 BERLIN_PINCTRL_FUNCTION(0x4, "lvds")),
196 BERLIN_PINCTRL_GROUP("GAV1", 0x24, 0x3, 0x0c,
197 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
198 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
199 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
200 BERLIN_PINCTRL_FUNCTION(0x4, "vga")),
201 BERLIN_PINCTRL_GROUP("GAV2", 0x24, 0x3, 0x0f,
202 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
203 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
204 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
205 BERLIN_PINCTRL_FUNCTION(0x3, "i2s3"),
206 BERLIN_PINCTRL_FUNCTION(0x4, "pdm"),
207 BERLIN_PINCTRL_FUNCTION(0x6, "adac")),
208 BERLIN_PINCTRL_GROUP("GAV3", 0x24, 0x3, 0x12,
209 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
210 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
211 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
212 BERLIN_PINCTRL_FUNCTION(0x3, "i2s3"),
213 BERLIN_PINCTRL_FUNCTION(0x6, "adac")),
214 BERLIN_PINCTRL_GROUP("GAV4", 0x24, 0x3, 0x15,
215 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
216 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
217 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
218 BERLIN_PINCTRL_FUNCTION(0x4, "i2s1"),
219 BERLIN_PINCTRL_FUNCTION(0x6, "adac")),
220 BERLIN_PINCTRL_GROUP("GAV5", 0x24, 0x3, 0x18,
221 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
222 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
223 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
224 BERLIN_PINCTRL_FUNCTION(0x4, "spdif")),
225 BERLIN_PINCTRL_GROUP("GAV6", 0x24, 0x3, 0x1b,
226 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
227 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
228 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
229 BERLIN_PINCTRL_FUNCTION(0x4, "i2s2")),
230 BERLIN_PINCTRL_GROUP("GAV7", 0x28, 0x3, 0x00,
231 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
232 BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
233 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
234 BERLIN_PINCTRL_FUNCTION(0x4, "i2s3")),
235 BERLIN_PINCTRL_GROUP("GAV8", 0x28, 0x3, 0x03,
236 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
237 BERLIN_PINCTRL_FUNCTION(0x1, "dv0"),
238 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
239 BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
240 BERLIN_PINCTRL_GROUP("GAV9", 0x28, 0x3, 0x06,
241 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
242 BERLIN_PINCTRL_FUNCTION(0x1, "dv0"),
243 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
244 BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
245 BERLIN_PINCTRL_GROUP("GAV10", 0x28, 0x3, 0x09,
246 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
247 BERLIN_PINCTRL_FUNCTION(0x1, "dv0"),
248 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
249 BERLIN_PINCTRL_FUNCTION(0x4, "agc")),
250 BERLIN_PINCTRL_GROUP("GAV11", 0x28, 0x3, 0x0c,
251 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
252 BERLIN_PINCTRL_FUNCTION(0x1, "dv0"),
253 BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
254 BERLIN_PINCTRL_FUNCTION(0x3, "i2s0"),
255 BERLIN_PINCTRL_FUNCTION(0x4, "pwm"),
256 BERLIN_PINCTRL_FUNCTION(0x5, "vclki")),
257 BERLIN_PINCTRL_GROUP("GAV12", 0x28, 0x3, 0x0f,
258 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
259 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
260 BERLIN_PINCTRL_FUNCTION(0x2, "i2s1")),
261 BERLIN_PINCTRL_GROUP("GAV13", 0x28, 0x3, 0x12,
262 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
263 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2")),
264 BERLIN_PINCTRL_GROUP("GAV14", 0x28, 0x3, 0x15,
265 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
266 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
267 BERLIN_PINCTRL_FUNCTION(0x2, "i2s1")),
268 BERLIN_PINCTRL_GROUP("GAV15", 0x28, 0x3, 0x18,
269 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
270 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
271 BERLIN_PINCTRL_FUNCTION(0x6, "dac_dbg")),
272 BERLIN_PINCTRL_GROUP("GAV16", 0x28, 0x3, 0x1b,
273 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
274 BERLIN_PINCTRL_FUNCTION(0x1, "i2s0"),
275 BERLIN_PINCTRL_FUNCTION(0x2, "i2s1"),
276 BERLIN_PINCTRL_FUNCTION(0x4, "i2s3"),
277 BERLIN_PINCTRL_FUNCTION(0x5, "pdm"),
278 BERLIN_PINCTRL_FUNCTION(0x6, "dac_dbg")),
279 BERLIN_PINCTRL_GROUP("GAV17", 0x2c, 0x3, 0x00,
280 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
281 BERLIN_PINCTRL_FUNCTION(0x1, "i2s0"),
282 BERLIN_PINCTRL_FUNCTION(0x2, "i2s1"),
283 BERLIN_PINCTRL_FUNCTION(0x3, "pwm"),
284 BERLIN_PINCTRL_FUNCTION(0x4, "i2s3"),
285 BERLIN_PINCTRL_FUNCTION(0x5, "pdm"),
286 BERLIN_PINCTRL_FUNCTION(0x6, "dac_dbg")),
287 BERLIN_PINCTRL_GROUP("GAV18", 0x2c, 0x3, 0x03,
288 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
289 BERLIN_PINCTRL_FUNCTION(0x1, "spdif"),
290 BERLIN_PINCTRL_FUNCTION(0x2, "arc")),
291 BERLIN_PINCTRL_GROUP("GAV19", 0x2c, 0x3, 0x06,
292 BERLIN_PINCTRL_FUNCTION(0x0, "avio"),
293 BERLIN_PINCTRL_FUNCTION(0x1, "spdif"),
294 BERLIN_PINCTRL_FUNCTION(0x4, "i2s3"),
295 BERLIN_PINCTRL_FUNCTION(0x5, "pdm")),
296 };
297
298 static const struct berlin_desc_group berlin2q_sysmgr_pinctrl_groups[] = {
299 /* GSM */
300 BERLIN_PINCTRL_GROUP("GSM0", 0x40, 0x2, 0x00,
301 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
302 BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS0n */
303 BERLIN_PINCTRL_FUNCTION(0x2, "eth1")),
304 BERLIN_PINCTRL_GROUP("GSM1", 0x40, 0x2, 0x02,
305 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
306 BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS1n */
307 BERLIN_PINCTRL_FUNCTION(0x2, "eth1")),
308 BERLIN_PINCTRL_GROUP("GSM2", 0x40, 0x2, 0x04,
309 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
310 BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS2n/SS3n */
311 BERLIN_PINCTRL_FUNCTION(0x2, "eddc")),
312 BERLIN_PINCTRL_GROUP("GSM3", 0x40, 0x2, 0x06,
313 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
314 BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* CLK/SDO */
315 BERLIN_PINCTRL_FUNCTION(0x2, "eddc")),
316 BERLIN_PINCTRL_GROUP("GSM4", 0x40, 0x1, 0x08,
317 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
318 BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
319 BERLIN_PINCTRL_GROUP("GSM5", 0x40, 0x1, 0x09,
320 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
321 BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
322 BERLIN_PINCTRL_GROUP("GSM6", 0x40, 0x1, 0x0a,
323 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
324 BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
325 BERLIN_PINCTRL_GROUP("GSM7", 0x40, 0x1, 0x0b,
326 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
327 BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
328 BERLIN_PINCTRL_GROUP("GSM8", 0x40, 0x1, 0x0c,
329 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
330 BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
331 BERLIN_PINCTRL_GROUP("GSM9", 0x40, 0x1, 0x0d,
332 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
333 BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
334 BERLIN_PINCTRL_GROUP("GSM10", 0x40, 0x1, 0x0e,
335 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
336 BERLIN_PINCTRL_FUNCTION(0x1, "led")),
337 BERLIN_PINCTRL_GROUP("GSM11", 0x40, 0x1, 0x0f,
338 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
339 BERLIN_PINCTRL_FUNCTION(0x1, "led")),
340 BERLIN_PINCTRL_GROUP("GSM12", 0x40, 0x2, 0x10,
341 BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* RX/TX */
342 BERLIN_PINCTRL_FUNCTION(0x1, "irda0"),
343 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
344 BERLIN_PINCTRL_GROUP("GSM13", 0x40, 0x2, 0x12,
345 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
346 BERLIN_PINCTRL_FUNCTION(0x1, "uart0"), /* CTS/RTS */
347 BERLIN_PINCTRL_FUNCTION(0x2, "uart1"), /* RX/TX */
348 BERLIN_PINCTRL_FUNCTION(0x3, "twsi2")),
349 BERLIN_PINCTRL_GROUP("GSM14", 0x40, 0x2, 0x14,
350 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
351 BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* RX/TX */
352 BERLIN_PINCTRL_FUNCTION(0x2, "irda1"),
353 BERLIN_PINCTRL_FUNCTION(0x3, "twsi3")),
354 BERLIN_PINCTRL_GROUP("GSM15", 0x40, 0x2, 0x16,
355 BERLIN_PINCTRL_FUNCTION(0x0, "pwr"),
356 BERLIN_PINCTRL_FUNCTION(0x1, "led"),
357 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
358 BERLIN_PINCTRL_GROUP("GSM16", 0x40, 0x1, 0x18,
359 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
360 BERLIN_PINCTRL_FUNCTION(0x1, "eddc")),
361 BERLIN_PINCTRL_GROUP("GSM17", 0x40, 0x1, 0x19,
362 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
363 BERLIN_PINCTRL_FUNCTION(0x1, "eddc")),
364 BERLIN_PINCTRL_GROUP("GSM18", 0x40, 0x1, 0x1a,
365 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
366 BERLIN_PINCTRL_FUNCTION(0x1, "eddc")),
367 };
368
369 static const struct berlin_pinctrl_desc berlin2q_soc_pinctrl_data = {
370 .groups = berlin2q_soc_pinctrl_groups,
371 .ngroups = ARRAY_SIZE(berlin2q_soc_pinctrl_groups),
372 };
373
374 static const struct berlin_pinctrl_desc berlin2q_sysmgr_pinctrl_data = {
375 .groups = berlin2q_sysmgr_pinctrl_groups,
376 .ngroups = ARRAY_SIZE(berlin2q_sysmgr_pinctrl_groups),
377 };
378
379 static const struct of_device_id berlin2q_pinctrl_match[] = {
380 {
381 .compatible = "marvell,berlin2q-soc-pinctrl",
382 .data = &berlin2q_soc_pinctrl_data,
383 },
384 {
385 .compatible = "marvell,berlin2q-system-pinctrl",
386 .data = &berlin2q_sysmgr_pinctrl_data,
387 },
388 {}
389 };
390
berlin2q_pinctrl_probe(struct platform_device * pdev)391 static int berlin2q_pinctrl_probe(struct platform_device *pdev)
392 {
393 return berlin_pinctrl_probe(pdev, device_get_match_data(&pdev->dev));
394 }
395
396 static struct platform_driver berlin2q_pinctrl_driver = {
397 .probe = berlin2q_pinctrl_probe,
398 .driver = {
399 .name = "berlin-bg2q-pinctrl",
400 .of_match_table = berlin2q_pinctrl_match,
401 },
402 };
403 builtin_platform_driver(berlin2q_pinctrl_driver);
404