This source file includes following definitions.
- as370_pinctrl_probe
1
2
3
4
5
6
7
8
9
10 #include <linux/init.h>
11 #include <linux/of_device.h>
12 #include <linux/platform_device.h>
13 #include <linux/regmap.h>
14
15 #include "berlin.h"
16
17 static const struct berlin_desc_group as370_soc_pinctrl_groups[] = {
18 BERLIN_PINCTRL_GROUP("I2S1_BCLKIO", 0x0, 0x3, 0x00,
19 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
20 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
21 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
22 BERLIN_PINCTRL_GROUP("I2S1_LRCKIO", 0x0, 0x3, 0x03,
23 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
24 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
25 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
26 BERLIN_PINCTRL_GROUP("I2S1_DO0", 0x0, 0x3, 0x06,
27 BERLIN_PINCTRL_FUNCTION(0x0, "por"),
28 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
29 BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
30 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
31 BERLIN_PINCTRL_GROUP("I2S1_DO1", 0x0, 0x3, 0x09,
32 BERLIN_PINCTRL_FUNCTION(0x0, "por"),
33 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
34 BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
35 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
36 BERLIN_PINCTRL_GROUP("I2S1_DO2", 0x0, 0x3, 0x0c,
37 BERLIN_PINCTRL_FUNCTION(0x0, "por"),
38 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
39 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
40 BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
41 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
42 BERLIN_PINCTRL_GROUP("I2S1_DO3", 0x0, 0x3, 0x0f,
43 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
44 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
45 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
46 BERLIN_PINCTRL_FUNCTION(0x3, "spdifib"),
47 BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
48 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
49 BERLIN_PINCTRL_GROUP("I2S1_MCLK", 0x0, 0x3, 0x12,
50 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
51 BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
52 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
53 BERLIN_PINCTRL_GROUP("I2S2_BCLKIO", 0x0, 0x3, 0x15,
54 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
55 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
56 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
57 BERLIN_PINCTRL_GROUP("I2S2_LRCKIO", 0x0, 0x3, 0x18,
58 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
59 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
60 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
61 BERLIN_PINCTRL_GROUP("I2S2_DI0", 0x0, 0x3, 0x1b,
62 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
63 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
64 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
65 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
66 BERLIN_PINCTRL_GROUP("I2S2_DI1", 0x4, 0x3, 0x00,
67 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
68 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
69 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
70 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
71 BERLIN_PINCTRL_GROUP("I2S2_DI2", 0x4, 0x3, 0x03,
72 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
73 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
74 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
75 BERLIN_PINCTRL_FUNCTION(0x3, "spdific"),
76 BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
77 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
78 BERLIN_PINCTRL_GROUP("I2S2_DI3", 0x4, 0x3, 0x06,
79 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
80 BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
81 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
82 BERLIN_PINCTRL_FUNCTION(0x3, "spdifia"),
83 BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
84 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
85 BERLIN_PINCTRL_GROUP("PDM_CLKO", 0x4, 0x3, 0x09,
86 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
87 BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
88 BERLIN_PINCTRL_FUNCTION(0x2, "i2s2"),
89 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
90 BERLIN_PINCTRL_GROUP("PDM_DI0", 0x4, 0x3, 0x0c,
91 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
92 BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
93 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
94 BERLIN_PINCTRL_GROUP("PDM_DI1", 0x4, 0x3, 0x0f,
95 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
96 BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
97 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
98 BERLIN_PINCTRL_GROUP("PDM_DI2", 0x4, 0x3, 0x12,
99 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
100 BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
101 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
102 BERLIN_PINCTRL_FUNCTION(0x3, "spdifid"),
103 BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
104 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
105 BERLIN_PINCTRL_GROUP("PDM_DI3", 0x4, 0x3, 0x15,
106 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
107 BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
108 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
109 BERLIN_PINCTRL_FUNCTION(0x3, "spdifi"),
110 BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
111 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
112 BERLIN_PINCTRL_GROUP("NAND_IO0", 0x4, 0x3, 0x18,
113 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
114 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
115 BERLIN_PINCTRL_FUNCTION(0x4, "pcie0")),
116 BERLIN_PINCTRL_GROUP("NAND_IO1", 0x4, 0x3, 0x1b,
117 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
118 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
119 BERLIN_PINCTRL_FUNCTION(0x4, "pcie0")),
120 BERLIN_PINCTRL_GROUP("NAND_IO2", 0x8, 0x3, 0x00,
121 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
122 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
123 BERLIN_PINCTRL_FUNCTION(0x4, "pcie1")),
124 BERLIN_PINCTRL_GROUP("NAND_IO3", 0x8, 0x3, 0x03,
125 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
126 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
127 BERLIN_PINCTRL_FUNCTION(0x4, "pcie1")),
128 BERLIN_PINCTRL_GROUP("NAND_IO4", 0x8, 0x3, 0x06,
129 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
130 BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
131 BERLIN_PINCTRL_GROUP("NAND_IO5", 0x8, 0x3, 0x09,
132 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
133 BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
134 BERLIN_PINCTRL_GROUP("NAND_IO6", 0x8, 0x3, 0x0c,
135 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
136 BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
137 BERLIN_PINCTRL_GROUP("NAND_IO7", 0x8, 0x3, 0x0f,
138 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
139 BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
140 BERLIN_PINCTRL_GROUP("NAND_ALE", 0x8, 0x3, 0x12,
141 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
142 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
143 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
144 BERLIN_PINCTRL_GROUP("NAND_CLE", 0x8, 0x3, 0x15,
145 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
146 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
147 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
148 BERLIN_PINCTRL_GROUP("NAND_WEn", 0x8, 0x3, 0x18,
149 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
150 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
151 BERLIN_PINCTRL_GROUP("NAND_REn", 0x8, 0x3, 0x1b,
152 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
153 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
154 BERLIN_PINCTRL_GROUP("NAND_WPn", 0xc, 0x3, 0x00,
155 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
156 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
157 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
158 BERLIN_PINCTRL_GROUP("NAND_CEn", 0xc, 0x3, 0x03,
159 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
160 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
161 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
162 BERLIN_PINCTRL_GROUP("NAND_RDY", 0xc, 0x3, 0x06,
163 BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
164 BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
165 BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
166 BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x09,
167 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
168 BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
169 BERLIN_PINCTRL_GROUP("SPI1_SS1n", 0xc, 0x3, 0x0c,
170 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
171 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
172 BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
173 BERLIN_PINCTRL_GROUP("SPI1_SS2n", 0xc, 0x3, 0x0f,
174 BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),
175 BERLIN_PINCTRL_FUNCTION(0x1, "spi1"),
176 BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
177 BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
178 BERLIN_PINCTRL_GROUP("SPI1_SS3n", 0xc, 0x3, 0x12,
179 BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),
180 BERLIN_PINCTRL_FUNCTION(0x1, "spi1"),
181 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
182 BERLIN_PINCTRL_GROUP("SPI1_SCLK", 0xc, 0x3, 0x15,
183 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
184 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
185 BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
186 BERLIN_PINCTRL_GROUP("SPI1_SDO", 0xc, 0x3, 0x18,
187 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
188 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
189 BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
190 BERLIN_PINCTRL_GROUP("SPI1_SDI", 0xc, 0x3, 0x1b,
191 BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
192 BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
193 BERLIN_PINCTRL_GROUP("USB0_DRV_VBUS", 0x10, 0x3, 0x00,
194 BERLIN_PINCTRL_FUNCTION(0x0, "usb0"),
195 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
196 BERLIN_PINCTRL_FUNCTION(0x3, "refclko")),
197 BERLIN_PINCTRL_GROUP("TW1_SCL", 0x10, 0x3, 0x03,
198 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
199 BERLIN_PINCTRL_FUNCTION(0x1, "tw1")),
200 BERLIN_PINCTRL_GROUP("TW1_SDA", 0x10, 0x3, 0x06,
201 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
202 BERLIN_PINCTRL_FUNCTION(0x1, "tw1")),
203 BERLIN_PINCTRL_GROUP("TW0_SCL", 0x10, 0x3, 0x09,
204 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
205 BERLIN_PINCTRL_FUNCTION(0x1, "tw0")),
206 BERLIN_PINCTRL_GROUP("TW0_SDA", 0x10, 0x3, 0x0c,
207 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
208 BERLIN_PINCTRL_FUNCTION(0x1, "tw0")),
209 BERLIN_PINCTRL_GROUP("TMS", 0x10, 0x3, 0x0f,
210 BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
211 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
212 BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
213 BERLIN_PINCTRL_GROUP("TDI", 0x10, 0x3, 0x12,
214 BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
215 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
216 BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
217 BERLIN_PINCTRL_GROUP("TDO", 0x10, 0x3, 0x15,
218 BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
219 BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
220 BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
221 BERLIN_PINCTRL_GROUP("PWM6", 0x10, 0x3, 0x18,
222 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
223 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
224 BERLIN_PINCTRL_GROUP("PWM7", 0x10, 0x3, 0x1b,
225 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
226 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
227 BERLIN_PINCTRL_GROUP("PWM0", 0x14, 0x3, 0x00,
228 BERLIN_PINCTRL_FUNCTION(0x0, "por"),
229 BERLIN_PINCTRL_FUNCTION(0x1, "pwm"),
230 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
231 BERLIN_PINCTRL_GROUP("PWM1", 0x14, 0x3, 0x03,
232 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
233 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
234 BERLIN_PINCTRL_GROUP("PWM2", 0x14, 0x3, 0x06,
235 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
236 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
237 BERLIN_PINCTRL_GROUP("PWM3", 0x14, 0x3, 0x09,
238 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
239 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
240 BERLIN_PINCTRL_GROUP("PWM4", 0x14, 0x3, 0x0c,
241 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
242 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
243 BERLIN_PINCTRL_GROUP("PWM5", 0x14, 0x3, 0x0f,
244 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
245 BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
246 BERLIN_PINCTRL_GROUP("URT1_RTSn", 0x14, 0x3, 0x12,
247 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
248 BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
249 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
250 BERLIN_PINCTRL_FUNCTION(0x3, "tw1a"),
251 BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
252 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
253 BERLIN_PINCTRL_GROUP("URT1_CTSn", 0x14, 0x3, 0x15,
254 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
255 BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
256 BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
257 BERLIN_PINCTRL_FUNCTION(0x3, "tw1a"),
258 BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
259 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
260 BERLIN_PINCTRL_GROUP("URT1_RXD", 0x14, 0x3, 0x18,
261 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
262 BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
263 BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
264 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
265 BERLIN_PINCTRL_GROUP("URT1_TXD", 0x14, 0x3, 0x1b,
266 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
267 BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
268 BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
269 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
270 BERLIN_PINCTRL_GROUP("I2S3_DI", 0x18, 0x3, 0x00,
271 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
272 BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"),
273 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
274 BERLIN_PINCTRL_GROUP("I2S3_DO", 0x18, 0x3, 0x03,
275 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
276 BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"),
277 BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
278 BERLIN_PINCTRL_GROUP("I2S3_BCLKIO", 0x18, 0x3, 0x06,
279 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
280 BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"),
281 BERLIN_PINCTRL_FUNCTION(0x5, "clk")),
282 BERLIN_PINCTRL_GROUP("I2S3_LRCKIO", 0x18, 0x3, 0x09,
283 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
284 BERLIN_PINCTRL_FUNCTION(0x1, "i2s3")),
285 BERLIN_PINCTRL_GROUP("SD0_DAT0", 0x18, 0x3, 0x0c,
286 BERLIN_PINCTRL_FUNCTION(0x0, "cpupll"),
287 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
288 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
289 BERLIN_PINCTRL_GROUP("SD0_DAT1", 0x18, 0x3, 0x0f,
290 BERLIN_PINCTRL_FUNCTION(0x0, "syspll"),
291 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
292 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
293 BERLIN_PINCTRL_GROUP("SD0_CLK", 0x18, 0x3, 0x12,
294 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
295 BERLIN_PINCTRL_FUNCTION(0x1, "sd0")),
296 BERLIN_PINCTRL_GROUP("SD0_DAT2", 0x18, 0x3, 0x15,
297 BERLIN_PINCTRL_FUNCTION(0x0, "mempll"),
298 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
299 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
300 BERLIN_PINCTRL_GROUP("SD0_DAT3", 0x18, 0x3, 0x18,
301 BERLIN_PINCTRL_FUNCTION(0x0, "apll0"),
302 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
303 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
304 BERLIN_PINCTRL_GROUP("SD0_CMD", 0x18, 0x3, 0x1b,
305 BERLIN_PINCTRL_FUNCTION(0x0, "apll1"),
306 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
307 BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
308 BERLIN_PINCTRL_GROUP("SD0_CDn", 0x1c, 0x3, 0x00,
309 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
310 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
311 BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
312 BERLIN_PINCTRL_GROUP("SD0_WP", 0x1c, 0x3, 0x03,
313 BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
314 BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
315 BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
316 };
317
318 static const struct berlin_pinctrl_desc as370_soc_pinctrl_data = {
319 .groups = as370_soc_pinctrl_groups,
320 .ngroups = ARRAY_SIZE(as370_soc_pinctrl_groups),
321 };
322
323 static const struct of_device_id as370_pinctrl_match[] = {
324 {
325 .compatible = "syna,as370-soc-pinctrl",
326 .data = &as370_soc_pinctrl_data,
327 },
328 {}
329 };
330
331 static int as370_pinctrl_probe(struct platform_device *pdev)
332 {
333 const struct of_device_id *match =
334 of_match_device(as370_pinctrl_match, &pdev->dev);
335 struct regmap_config *rmconfig;
336 struct regmap *regmap;
337 struct resource *res;
338 void __iomem *base;
339
340 rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
341 if (!rmconfig)
342 return -ENOMEM;
343
344 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
345 base = devm_ioremap_resource(&pdev->dev, res);
346 if (IS_ERR(base))
347 return PTR_ERR(base);
348
349 rmconfig->reg_bits = 32,
350 rmconfig->val_bits = 32,
351 rmconfig->reg_stride = 4,
352 rmconfig->max_register = resource_size(res);
353
354 regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
355 if (IS_ERR(regmap))
356 return PTR_ERR(regmap);
357
358 return berlin_pinctrl_probe_regmap(pdev, match->data, regmap);
359 }
360
361 static struct platform_driver as370_pinctrl_driver = {
362 .probe = as370_pinctrl_probe,
363 .driver = {
364 .name = "as370-pinctrl",
365 .of_match_table = as370_pinctrl_match,
366 },
367 };
368 builtin_platform_driver(as370_pinctrl_driver);