1c6114f21SJisheng Zhang // SPDX-License-Identifier: GPL-2.0
2b016d1bdSAntoine Tenart /*
3b016d1bdSAntoine Tenart  * Marvell Berlin BG2 pinctrl driver.
4b016d1bdSAntoine Tenart  *
5b016d1bdSAntoine Tenart  * Copyright (C) 2014 Marvell Technology Group Ltd.
6b016d1bdSAntoine Tenart  *
71d48fb6eSAntoine Ténart  * Antoine Ténart <antoine.tenart@free-electrons.com>
8b016d1bdSAntoine Tenart  */
9b016d1bdSAntoine Tenart 
109ec1a286SPaul Gortmaker #include <linux/init.h>
11b016d1bdSAntoine Tenart #include <linux/of_device.h>
12b016d1bdSAntoine Tenart #include <linux/platform_device.h>
13b016d1bdSAntoine Tenart #include <linux/regmap.h>
14b016d1bdSAntoine Tenart 
15b016d1bdSAntoine Tenart #include "berlin.h"
16b016d1bdSAntoine Tenart 
17b016d1bdSAntoine Tenart static const struct berlin_desc_group berlin2_soc_pinctrl_groups[] = {
18b016d1bdSAntoine Tenart 	/* G */
19b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G0", 0x00, 0x1, 0x00,
202e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n */
21b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
22b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G1", 0x00, 0x2, 0x01,
232e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS1n */
24b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
25b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "usb1")),
26b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G2", 0x00, 0x2, 0x02,
27b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
282e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS2n */
29b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
30b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "i2s0")),
31b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G3", 0x00, 0x2, 0x04,
32b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "soc"),
332e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS3n */
34b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
35b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "i2s1")),
36b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G4", 0x00, 0x2, 0x06,
372e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* CLK/SDI/SDO */
38b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
39b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "pwm")),
40b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G5", 0x00, 0x3, 0x08,
41b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
42b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
43b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "et"),
44b016d1bdSAntoine Tenart 		/*
45b016d1bdSAntoine Tenart 		 * Mode 0x3 mux i2s2 mclk *and* i2s3 mclk:
46b016d1bdSAntoine Tenart 		 * add two functions so it can be used with other groups
47b016d1bdSAntoine Tenart 		 * within the same subnode in the device tree
48b016d1bdSAntoine Tenart 		 */
49b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "i2s2"),
50b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "i2s3")),
51b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G6", 0x00, 0x2, 0x0b,
52b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
53b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
54b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "et")),
55b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G7", 0x00, 0x3, 0x0d,
56b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
57b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
58b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "et"),
59b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "vdac")),
60b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G8", 0x00, 0x3, 0x10,
61b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
62b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
63b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "et"),
64b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "usb0_dbg"),
65b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "sata_dbg"),
66b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
67b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G9", 0x00, 0x3, 0x13,
68b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
69b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
70b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "et"),
71b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "usb0_dbg"),
72b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "sata_dbg"),
73b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
74b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G10", 0x00, 0x2, 0x16,
75b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "soc"),
76b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "twsi0"),
77b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
78b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "ptp")),
79b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G11", 0x00, 0x2, 0x18,
80b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "soc"),
81b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "twsi1"),
82b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
83b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "eddc")),
84b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G12", 0x00, 0x3, 0x1a,
85b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "sts2"),
86b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sata"),
87b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
88b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "usb0_dbg"),
89b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
90b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
91b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G13", 0x04, 0x3, 0x00,
92b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
93b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "sata"),
94b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
95b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "usb0_dbg"),
96b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "sts1"),
97b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
98b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G14", 0x04, 0x1, 0x03,
99b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION_UNKNOWN),
100b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G15", 0x04, 0x2, 0x04,
101b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
102b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "et"),
103b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "osco")),
104b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G16", 0x04, 0x3, 0x06,
105b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
106b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
107b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "fp")),
108b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G17", 0x04, 0x3, 0x09,
109b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
110b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
111b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "fp")),
112b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G18", 0x04, 0x1, 0x0c,
113b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "pll"),
114b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "i2s0")),
115b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G19", 0x04, 0x1, 0x0d,
116b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "i2s0"),
117b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
118b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G20", 0x04, 0x1, 0x0e,
119b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "spdif"),
120b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "arc")),
121b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G21", 0x04, 0x3, 0x0f,
122b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
123b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "dvio"),
124b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
125b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "adac_dbg"),
126b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "pdm_a"),	/* gpio17..19,pdm */
127b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x7, "pdm_b")),	/* gpio12..14,pdm */
128b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G22", 0x04, 0x3, 0x12,
129b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
130b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "dv0"),
131b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
132b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "twsi0"),
133b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
134b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G23", 0x04, 0x3, 0x15,
135b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "vclki"),
136b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "dv0"),
137b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "fp"),
138b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "i2s0"),
139b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x4, "pwm"),
140b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x7, "pdm")),
141b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G24", 0x04, 0x2, 0x18,
142b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "i2s2"),
143b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "i2s1")),
144b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G25", 0x04, 0x2, 0x1a,
145b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
146b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "nand"),
147b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "i2s2")),
148b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G26", 0x04, 0x1, 0x1c,
149b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
150b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
151b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G27", 0x04, 0x1, 0x1d,
152b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
153b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "nand")),
154b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("G28", 0x04, 0x2, 0x1e,
155b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "dvo"),
156b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "sp")),
157b016d1bdSAntoine Tenart };
158b016d1bdSAntoine Tenart 
159b016d1bdSAntoine Tenart static const struct berlin_desc_group berlin2_sysmgr_pinctrl_groups[] = {
160b016d1bdSAntoine Tenart 	/* GSM */
161b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM0", 0x40, 0x2, 0x00,
162b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
1632e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS0n */
164b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "eth1")),
165b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM1", 0x40, 0x2, 0x02,
166b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
1672e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS1n */
168b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "eth1")),
169b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM2", 0x40, 0x2, 0x04,
170b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "twsi2"),
1712e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "spi2")), /* SS2n/SS3n */
172b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM3", 0x40, 0x2, 0x06,
173b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
174b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "uart0"),	/* CTS/RTS */
175b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "uart2"),	/* RX/TX */
176b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "twsi2")),
177b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM4", 0x40, 0x2, 0x08,
178b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),	/* RX/TX */
179b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "irda0")),
180b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM5", 0x40, 0x2, 0x0a,
181b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
182b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),	/* RX/TX */
183b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x2, "irda1"),
184b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x3, "twsi3")),
185b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM6", 0x40, 0x2, 0x0c,
186b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
1872e89f4c3SAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* CLK/SDO */
188b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "clki")),
189b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM7", 0x40, 0x1, 0x0e,
190b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
191b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
192b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM8", 0x40, 0x1, 0x0f,
193b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
194b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
195b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM9", 0x40, 0x1, 0x10,
196b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
197b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "led")),
198b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM10", 0x40, 0x1, 0x11,
199b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
200b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "led")),
201b016d1bdSAntoine Tenart 	BERLIN_PINCTRL_GROUP("GSM11", 0x40, 0x1, 0x12,
202b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
203b016d1bdSAntoine Tenart 		BERLIN_PINCTRL_FUNCTION(0x1, "led")),
204b016d1bdSAntoine Tenart };
205b016d1bdSAntoine Tenart 
206b016d1bdSAntoine Tenart static const struct berlin_pinctrl_desc berlin2_soc_pinctrl_data = {
207b016d1bdSAntoine Tenart 	.groups = berlin2_soc_pinctrl_groups,
208b016d1bdSAntoine Tenart 	.ngroups = ARRAY_SIZE(berlin2_soc_pinctrl_groups),
209b016d1bdSAntoine Tenart };
210b016d1bdSAntoine Tenart 
211b016d1bdSAntoine Tenart static const struct berlin_pinctrl_desc berlin2_sysmgr_pinctrl_data = {
212b016d1bdSAntoine Tenart 	.groups = berlin2_sysmgr_pinctrl_groups,
213b016d1bdSAntoine Tenart 	.ngroups = ARRAY_SIZE(berlin2_sysmgr_pinctrl_groups),
214b016d1bdSAntoine Tenart };
215b016d1bdSAntoine Tenart 
216b016d1bdSAntoine Tenart static const struct of_device_id berlin2_pinctrl_match[] = {
217b016d1bdSAntoine Tenart 	{
218f52bf55cSAntoine Tenart 		.compatible = "marvell,berlin2-soc-pinctrl",
219b016d1bdSAntoine Tenart 		.data = &berlin2_soc_pinctrl_data
220b016d1bdSAntoine Tenart 	},
221b016d1bdSAntoine Tenart 	{
222f52bf55cSAntoine Tenart 		.compatible = "marvell,berlin2-system-pinctrl",
223b016d1bdSAntoine Tenart 		.data = &berlin2_sysmgr_pinctrl_data
224b016d1bdSAntoine Tenart 	},
225b016d1bdSAntoine Tenart 	{}
226b016d1bdSAntoine Tenart };
227b016d1bdSAntoine Tenart 
berlin2_pinctrl_probe(struct platform_device * pdev)228b016d1bdSAntoine Tenart static int berlin2_pinctrl_probe(struct platform_device *pdev)
229b016d1bdSAntoine Tenart {
230b016d1bdSAntoine Tenart 	const struct of_device_id *match =
231b016d1bdSAntoine Tenart 		of_match_device(berlin2_pinctrl_match, &pdev->dev);
232b016d1bdSAntoine Tenart 
233b016d1bdSAntoine Tenart 	return berlin_pinctrl_probe(pdev, match->data);
234b016d1bdSAntoine Tenart }
235b016d1bdSAntoine Tenart 
236b016d1bdSAntoine Tenart static struct platform_driver berlin2_pinctrl_driver = {
237b016d1bdSAntoine Tenart 	.probe	= berlin2_pinctrl_probe,
238b016d1bdSAntoine Tenart 	.driver	= {
239b016d1bdSAntoine Tenart 		.name = "berlin-bg2-pinctrl",
240b016d1bdSAntoine Tenart 		.of_match_table = berlin2_pinctrl_match,
241b016d1bdSAntoine Tenart 	},
242b016d1bdSAntoine Tenart };
2439ec1a286SPaul Gortmaker builtin_platform_driver(berlin2_pinctrl_driver);
244