xref: /openbmc/linux/drivers/pinctrl/samsung/pinctrl-exynos-arm.c (revision de167752a889d19b9bb018f8eecbc1ebbfe07b2f)
1 // SPDX-License-Identifier: GPL-2.0+
2 //
3 // Exynos specific support for Samsung pinctrl/gpiolib driver with eint support.
4 //
5 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 //		http://www.samsung.com
7 // Copyright (c) 2012 Linaro Ltd
8 //		http://www.linaro.org
9 //
10 // Author: Thomas Abraham <thomas.ab@samsung.com>
11 //
12 // This file contains the Samsung Exynos specific information required by the
13 // the Samsung pinctrl/gpiolib driver. It also includes the implementation of
14 // external gpio and wakeup interrupt support.
15 
16 #include <linux/device.h>
17 #include <linux/of_address.h>
18 #include <linux/slab.h>
19 #include <linux/err.h>
20 #include <linux/soc/samsung/exynos-regs-pmu.h>
21 
22 #include "pinctrl-samsung.h"
23 #include "pinctrl-exynos.h"
24 
25 static const struct samsung_pin_bank_type bank_type_off = {
26 	.fld_width = { 4, 1, 2, 2, 2, 2, },
27 	.reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
28 };
29 
30 static const struct samsung_pin_bank_type bank_type_alive = {
31 	.fld_width = { 4, 1, 2, 2, },
32 	.reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
33 };
34 
35 /* Retention control for S5PV210 are located at the end of clock controller */
36 #define S5P_OTHERS 0xE000
37 
38 #define S5P_OTHERS_RET_IO		(1 << 31)
39 #define S5P_OTHERS_RET_CF		(1 << 30)
40 #define S5P_OTHERS_RET_MMC		(1 << 29)
41 #define S5P_OTHERS_RET_UART		(1 << 28)
42 
43 static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata)
44 {
45 	void __iomem *clk_base = (void __iomem *)drvdata->retention_ctrl->priv;
46 	u32 tmp;
47 
48 	tmp = __raw_readl(clk_base + S5P_OTHERS);
49 	tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF | S5P_OTHERS_RET_MMC |
50 		S5P_OTHERS_RET_UART);
51 	__raw_writel(tmp, clk_base + S5P_OTHERS);
52 }
53 
54 static struct samsung_retention_ctrl *
55 s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata,
56 		       const struct samsung_retention_data *data)
57 {
58 	struct samsung_retention_ctrl *ctrl;
59 	struct device_node *np;
60 	void __iomem *clk_base;
61 
62 	ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL);
63 	if (!ctrl)
64 		return ERR_PTR(-ENOMEM);
65 
66 	np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock");
67 	if (!np) {
68 		pr_err("%s: failed to find clock controller DT node\n",
69 			__func__);
70 		return ERR_PTR(-ENODEV);
71 	}
72 
73 	clk_base = of_iomap(np, 0);
74 	if (!clk_base) {
75 		pr_err("%s: failed to map clock registers\n", __func__);
76 		return ERR_PTR(-EINVAL);
77 	}
78 
79 	ctrl->priv = (void __force *)clk_base;
80 	ctrl->disable = s5pv210_retention_disable;
81 
82 	return ctrl;
83 }
84 
85 static const struct samsung_retention_data s5pv210_retention_data __initconst = {
86 	.init	 = s5pv210_retention_init,
87 };
88 
89 /* pin banks of s5pv210 pin-controller */
90 static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = {
91 	/* Must start with EINTG banks, ordered by EINT group number. */
92 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
93 	EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
94 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
95 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
96 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
97 	EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
98 	EXYNOS_PIN_BANK_EINTG(6, 0x0c0, "gpd1", 0x18),
99 	EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe0", 0x1c),
100 	EXYNOS_PIN_BANK_EINTG(5, 0x100, "gpe1", 0x20),
101 	EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpf0", 0x24),
102 	EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28),
103 	EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c),
104 	EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30),
105 	EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34),
106 	EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38),
107 	EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c),
108 	EXYNOS_PIN_BANK_EINTG(7, 0x200, "gpg3", 0x40),
109 	EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x44),
110 	EXYNOS_PIN_BANK_EINTG(6, 0x260, "gpj1", 0x48),
111 	EXYNOS_PIN_BANK_EINTG(8, 0x280, "gpj2", 0x4c),
112 	EXYNOS_PIN_BANK_EINTG(8, 0x2a0, "gpj3", 0x50),
113 	EXYNOS_PIN_BANK_EINTG(5, 0x2c0, "gpj4", 0x54),
114 	EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"),
115 	EXYNOS_PIN_BANK_EINTN(8, 0x2e0, "mp01"),
116 	EXYNOS_PIN_BANK_EINTN(4, 0x300, "mp02"),
117 	EXYNOS_PIN_BANK_EINTN(8, 0x320, "mp03"),
118 	EXYNOS_PIN_BANK_EINTN(8, 0x340, "mp04"),
119 	EXYNOS_PIN_BANK_EINTN(8, 0x360, "mp05"),
120 	EXYNOS_PIN_BANK_EINTN(8, 0x380, "mp06"),
121 	EXYNOS_PIN_BANK_EINTN(8, 0x3a0, "mp07"),
122 	EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gph0", 0x00),
123 	EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gph1", 0x04),
124 	EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gph2", 0x08),
125 	EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gph3", 0x0c),
126 };
127 
128 static const struct samsung_pin_ctrl s5pv210_pin_ctrl[] __initconst = {
129 	{
130 		/* pin-controller instance 0 data */
131 		.pin_banks	= s5pv210_pin_bank,
132 		.nr_banks	= ARRAY_SIZE(s5pv210_pin_bank),
133 		.eint_gpio_init = exynos_eint_gpio_init,
134 		.eint_wkup_init = exynos_eint_wkup_init,
135 		.suspend	= exynos_pinctrl_suspend,
136 		.resume		= exynos_pinctrl_resume,
137 		.retention_data	= &s5pv210_retention_data,
138 	},
139 };
140 
141 const struct samsung_pinctrl_of_match_data s5pv210_of_data __initconst = {
142 	.ctrl		= s5pv210_pin_ctrl,
143 	.num_ctrl	= ARRAY_SIZE(s5pv210_pin_ctrl),
144 };
145 
146 /* Pad retention control code for accessing PMU regmap */
147 static atomic_t exynos_shared_retention_refcnt;
148 
149 /* pin banks of exynos3250 pin-controller 0 */
150 static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = {
151 	/* Must start with EINTG banks, ordered by EINT group number. */
152 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
153 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
154 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb",  0x08),
155 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
156 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
157 	EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
158 	EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18),
159 };
160 
161 /* pin banks of exynos3250 pin-controller 1 */
162 static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst = {
163 	/* Must start with EINTG banks, ordered by EINT group number. */
164 	EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"),
165 	EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"),
166 	EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"),
167 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpk0", 0x08),
168 	EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
169 	EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
170 	EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpl0", 0x18),
171 	EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
172 	EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
173 	EXYNOS_PIN_BANK_EINTG(5, 0x2a0, "gpm2", 0x2c),
174 	EXYNOS_PIN_BANK_EINTG(8, 0x2c0, "gpm3", 0x30),
175 	EXYNOS_PIN_BANK_EINTG(8, 0x2e0, "gpm4", 0x34),
176 	EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00),
177 	EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04),
178 	EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08),
179 	EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
180 };
181 
182 /*
183  * PMU pad retention groups for Exynos3250 doesn't match pin banks, so handle
184  * them all together
185  */
186 static const u32 exynos3250_retention_regs[] = {
187 	S5P_PAD_RET_MAUDIO_OPTION,
188 	S5P_PAD_RET_GPIO_OPTION,
189 	S5P_PAD_RET_UART_OPTION,
190 	S5P_PAD_RET_MMCA_OPTION,
191 	S5P_PAD_RET_MMCB_OPTION,
192 	S5P_PAD_RET_EBIA_OPTION,
193 	S5P_PAD_RET_EBIB_OPTION,
194 	S5P_PAD_RET_MMC2_OPTION,
195 	S5P_PAD_RET_SPI_OPTION,
196 };
197 
198 static const struct samsung_retention_data exynos3250_retention_data __initconst = {
199 	.regs	 = exynos3250_retention_regs,
200 	.nr_regs = ARRAY_SIZE(exynos3250_retention_regs),
201 	.value	 = EXYNOS_WAKEUP_FROM_LOWPWR,
202 	.refcnt	 = &exynos_shared_retention_refcnt,
203 	.init	 = exynos_retention_init,
204 };
205 
206 /*
207  * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes
208  * two gpio/pin-mux/pinconfig controllers.
209  */
210 static const struct samsung_pin_ctrl exynos3250_pin_ctrl[] __initconst = {
211 	{
212 		/* pin-controller instance 0 data */
213 		.pin_banks	= exynos3250_pin_banks0,
214 		.nr_banks	= ARRAY_SIZE(exynos3250_pin_banks0),
215 		.eint_gpio_init = exynos_eint_gpio_init,
216 		.suspend	= exynos_pinctrl_suspend,
217 		.resume		= exynos_pinctrl_resume,
218 		.retention_data	= &exynos3250_retention_data,
219 	}, {
220 		/* pin-controller instance 1 data */
221 		.pin_banks	= exynos3250_pin_banks1,
222 		.nr_banks	= ARRAY_SIZE(exynos3250_pin_banks1),
223 		.eint_gpio_init = exynos_eint_gpio_init,
224 		.eint_wkup_init = exynos_eint_wkup_init,
225 		.suspend	= exynos_pinctrl_suspend,
226 		.resume		= exynos_pinctrl_resume,
227 		.retention_data	= &exynos3250_retention_data,
228 	},
229 };
230 
231 const struct samsung_pinctrl_of_match_data exynos3250_of_data __initconst = {
232 	.ctrl		= exynos3250_pin_ctrl,
233 	.num_ctrl	= ARRAY_SIZE(exynos3250_pin_ctrl),
234 };
235 
236 /* pin banks of exynos4210 pin-controller 0 */
237 static const struct samsung_pin_bank_data exynos4210_pin_banks0[] __initconst = {
238 	/* Must start with EINTG banks, ordered by EINT group number. */
239 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
240 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
241 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
242 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
243 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
244 	EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
245 	EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
246 	EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
247 	EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
248 	EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
249 	EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
250 	EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
251 	EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
252 	EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
253 	EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
254 	EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
255 };
256 
257 /* pin banks of exynos4210 pin-controller 1 */
258 static const struct samsung_pin_bank_data exynos4210_pin_banks1[] __initconst = {
259 	/* Must start with EINTG banks, ordered by EINT group number. */
260 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
261 	EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
262 	EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
263 	EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
264 	EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
265 	EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
266 	EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
267 	EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
268 	EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
269 	EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
270 	EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
271 	EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
272 	EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
273 	EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
274 	EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
275 	EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
276 	EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
277 	EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
278 	EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
279 	EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
280 };
281 
282 /* pin banks of exynos4210 pin-controller 2 */
283 static const struct samsung_pin_bank_data exynos4210_pin_banks2[] __initconst = {
284 	/* Must start with EINTG banks, ordered by EINT group number. */
285 	EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
286 };
287 
288 /* PMU pad retention groups registers for Exynos4 (without audio) */
289 static const u32 exynos4_retention_regs[] = {
290 	S5P_PAD_RET_GPIO_OPTION,
291 	S5P_PAD_RET_UART_OPTION,
292 	S5P_PAD_RET_MMCA_OPTION,
293 	S5P_PAD_RET_MMCB_OPTION,
294 	S5P_PAD_RET_EBIA_OPTION,
295 	S5P_PAD_RET_EBIB_OPTION,
296 };
297 
298 static const struct samsung_retention_data exynos4_retention_data __initconst = {
299 	.regs	 = exynos4_retention_regs,
300 	.nr_regs = ARRAY_SIZE(exynos4_retention_regs),
301 	.value	 = EXYNOS_WAKEUP_FROM_LOWPWR,
302 	.refcnt	 = &exynos_shared_retention_refcnt,
303 	.init	 = exynos_retention_init,
304 };
305 
306 /* PMU retention control for audio pins can be tied to audio pin bank */
307 static const u32 exynos4_audio_retention_regs[] = {
308 	S5P_PAD_RET_MAUDIO_OPTION,
309 };
310 
311 static const struct samsung_retention_data exynos4_audio_retention_data __initconst = {
312 	.regs	 = exynos4_audio_retention_regs,
313 	.nr_regs = ARRAY_SIZE(exynos4_audio_retention_regs),
314 	.value	 = EXYNOS_WAKEUP_FROM_LOWPWR,
315 	.init	 = exynos_retention_init,
316 };
317 
318 /*
319  * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
320  * three gpio/pin-mux/pinconfig controllers.
321  */
322 static const struct samsung_pin_ctrl exynos4210_pin_ctrl[] __initconst = {
323 	{
324 		/* pin-controller instance 0 data */
325 		.pin_banks	= exynos4210_pin_banks0,
326 		.nr_banks	= ARRAY_SIZE(exynos4210_pin_banks0),
327 		.eint_gpio_init = exynos_eint_gpio_init,
328 		.suspend	= exynos_pinctrl_suspend,
329 		.resume		= exynos_pinctrl_resume,
330 		.retention_data	= &exynos4_retention_data,
331 	}, {
332 		/* pin-controller instance 1 data */
333 		.pin_banks	= exynos4210_pin_banks1,
334 		.nr_banks	= ARRAY_SIZE(exynos4210_pin_banks1),
335 		.eint_gpio_init = exynos_eint_gpio_init,
336 		.eint_wkup_init = exynos_eint_wkup_init,
337 		.suspend	= exynos_pinctrl_suspend,
338 		.resume		= exynos_pinctrl_resume,
339 		.retention_data	= &exynos4_retention_data,
340 	}, {
341 		/* pin-controller instance 2 data */
342 		.pin_banks	= exynos4210_pin_banks2,
343 		.nr_banks	= ARRAY_SIZE(exynos4210_pin_banks2),
344 		.retention_data	= &exynos4_audio_retention_data,
345 	},
346 };
347 
348 const struct samsung_pinctrl_of_match_data exynos4210_of_data __initconst = {
349 	.ctrl		= exynos4210_pin_ctrl,
350 	.num_ctrl	= ARRAY_SIZE(exynos4210_pin_ctrl),
351 };
352 
353 /* pin banks of exynos4x12 pin-controller 0 */
354 static const struct samsung_pin_bank_data exynos4x12_pin_banks0[] __initconst = {
355 	/* Must start with EINTG banks, ordered by EINT group number. */
356 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
357 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
358 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
359 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
360 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
361 	EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
362 	EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
363 	EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
364 	EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
365 	EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
366 	EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
367 	EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
368 	EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
369 };
370 
371 /* pin banks of exynos4x12 pin-controller 1 */
372 static const struct samsung_pin_bank_data exynos4x12_pin_banks1[] __initconst = {
373 	/* Must start with EINTG banks, ordered by EINT group number. */
374 	EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
375 	EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
376 	EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
377 	EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
378 	EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
379 	EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
380 	EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
381 	EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
382 	EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
383 	EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
384 	EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
385 	EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
386 	EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
387 	EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
388 	EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
389 	EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
390 	EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
391 	EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
392 	EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
393 	EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
394 	EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
395 	EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
396 	EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
397 };
398 
399 /* pin banks of exynos4x12 pin-controller 2 */
400 static const struct samsung_pin_bank_data exynos4x12_pin_banks2[] __initconst = {
401 	/* Must start with EINTG banks, ordered by EINT group number. */
402 	EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
403 };
404 
405 /* pin banks of exynos4x12 pin-controller 3 */
406 static const struct samsung_pin_bank_data exynos4x12_pin_banks3[] __initconst = {
407 	/* Must start with EINTG banks, ordered by EINT group number. */
408 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
409 	EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
410 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
411 	EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
412 	EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
413 };
414 
415 /*
416  * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
417  * four gpio/pin-mux/pinconfig controllers.
418  */
419 static const struct samsung_pin_ctrl exynos4x12_pin_ctrl[] __initconst = {
420 	{
421 		/* pin-controller instance 0 data */
422 		.pin_banks	= exynos4x12_pin_banks0,
423 		.nr_banks	= ARRAY_SIZE(exynos4x12_pin_banks0),
424 		.eint_gpio_init = exynos_eint_gpio_init,
425 		.suspend	= exynos_pinctrl_suspend,
426 		.resume		= exynos_pinctrl_resume,
427 		.retention_data	= &exynos4_retention_data,
428 	}, {
429 		/* pin-controller instance 1 data */
430 		.pin_banks	= exynos4x12_pin_banks1,
431 		.nr_banks	= ARRAY_SIZE(exynos4x12_pin_banks1),
432 		.eint_gpio_init = exynos_eint_gpio_init,
433 		.eint_wkup_init = exynos_eint_wkup_init,
434 		.suspend	= exynos_pinctrl_suspend,
435 		.resume		= exynos_pinctrl_resume,
436 		.retention_data	= &exynos4_retention_data,
437 	}, {
438 		/* pin-controller instance 2 data */
439 		.pin_banks	= exynos4x12_pin_banks2,
440 		.nr_banks	= ARRAY_SIZE(exynos4x12_pin_banks2),
441 		.eint_gpio_init = exynos_eint_gpio_init,
442 		.suspend	= exynos_pinctrl_suspend,
443 		.resume		= exynos_pinctrl_resume,
444 		.retention_data	= &exynos4_audio_retention_data,
445 	}, {
446 		/* pin-controller instance 3 data */
447 		.pin_banks	= exynos4x12_pin_banks3,
448 		.nr_banks	= ARRAY_SIZE(exynos4x12_pin_banks3),
449 		.eint_gpio_init = exynos_eint_gpio_init,
450 		.suspend	= exynos_pinctrl_suspend,
451 		.resume		= exynos_pinctrl_resume,
452 	},
453 };
454 
455 const struct samsung_pinctrl_of_match_data exynos4x12_of_data __initconst = {
456 	.ctrl		= exynos4x12_pin_ctrl,
457 	.num_ctrl	= ARRAY_SIZE(exynos4x12_pin_ctrl),
458 };
459 
460 /* pin banks of exynos5250 pin-controller 0 */
461 static const struct samsung_pin_bank_data exynos5250_pin_banks0[] __initconst = {
462 	/* Must start with EINTG banks, ordered by EINT group number. */
463 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
464 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
465 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
466 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
467 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
468 	EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
469 	EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
470 	EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
471 	EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc1", 0x20),
472 	EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc2", 0x24),
473 	EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc3", 0x28),
474 	EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpd0", 0x2c),
475 	EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x30),
476 	EXYNOS_PIN_BANK_EINTG(7, 0x2E0, "gpc4", 0x34),
477 	EXYNOS_PIN_BANK_EINTN(6, 0x1A0, "gpy0"),
478 	EXYNOS_PIN_BANK_EINTN(4, 0x1C0, "gpy1"),
479 	EXYNOS_PIN_BANK_EINTN(6, 0x1E0, "gpy2"),
480 	EXYNOS_PIN_BANK_EINTN(8, 0x200, "gpy3"),
481 	EXYNOS_PIN_BANK_EINTN(8, 0x220, "gpy4"),
482 	EXYNOS_PIN_BANK_EINTN(8, 0x240, "gpy5"),
483 	EXYNOS_PIN_BANK_EINTN(8, 0x260, "gpy6"),
484 	EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
485 	EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
486 	EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
487 	EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
488 };
489 
490 /* pin banks of exynos5250 pin-controller 1 */
491 static const struct samsung_pin_bank_data exynos5250_pin_banks1[] __initconst = {
492 	/* Must start with EINTG banks, ordered by EINT group number. */
493 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
494 	EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
495 	EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08),
496 	EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf1", 0x0c),
497 	EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
498 	EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
499 	EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
500 	EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gph0", 0x1c),
501 	EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph1", 0x20),
502 };
503 
504 /* pin banks of exynos5250 pin-controller 2 */
505 static const struct samsung_pin_bank_data exynos5250_pin_banks2[] __initconst = {
506 	/* Must start with EINTG banks, ordered by EINT group number. */
507 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
508 	EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
509 	EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
510 	EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
511 	EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
512 };
513 
514 /* pin banks of exynos5250 pin-controller 3 */
515 static const struct samsung_pin_bank_data exynos5250_pin_banks3[] __initconst = {
516 	/* Must start with EINTG banks, ordered by EINT group number. */
517 	EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
518 };
519 
520 /*
521  * Samsung pinctrl driver data for Exynos5250 SoC. Exynos5250 SoC includes
522  * four gpio/pin-mux/pinconfig controllers.
523  */
524 static const struct samsung_pin_ctrl exynos5250_pin_ctrl[] __initconst = {
525 	{
526 		/* pin-controller instance 0 data */
527 		.pin_banks	= exynos5250_pin_banks0,
528 		.nr_banks	= ARRAY_SIZE(exynos5250_pin_banks0),
529 		.eint_gpio_init = exynos_eint_gpio_init,
530 		.eint_wkup_init = exynos_eint_wkup_init,
531 		.suspend	= exynos_pinctrl_suspend,
532 		.resume		= exynos_pinctrl_resume,
533 		.retention_data	= &exynos4_retention_data,
534 	}, {
535 		/* pin-controller instance 1 data */
536 		.pin_banks	= exynos5250_pin_banks1,
537 		.nr_banks	= ARRAY_SIZE(exynos5250_pin_banks1),
538 		.eint_gpio_init = exynos_eint_gpio_init,
539 		.suspend	= exynos_pinctrl_suspend,
540 		.resume		= exynos_pinctrl_resume,
541 		.retention_data	= &exynos4_retention_data,
542 	}, {
543 		/* pin-controller instance 2 data */
544 		.pin_banks	= exynos5250_pin_banks2,
545 		.nr_banks	= ARRAY_SIZE(exynos5250_pin_banks2),
546 		.eint_gpio_init = exynos_eint_gpio_init,
547 		.suspend	= exynos_pinctrl_suspend,
548 		.resume		= exynos_pinctrl_resume,
549 	}, {
550 		/* pin-controller instance 3 data */
551 		.pin_banks	= exynos5250_pin_banks3,
552 		.nr_banks	= ARRAY_SIZE(exynos5250_pin_banks3),
553 		.eint_gpio_init = exynos_eint_gpio_init,
554 		.suspend	= exynos_pinctrl_suspend,
555 		.resume		= exynos_pinctrl_resume,
556 		.retention_data	= &exynos4_audio_retention_data,
557 	},
558 };
559 
560 const struct samsung_pinctrl_of_match_data exynos5250_of_data __initconst = {
561 	.ctrl		= exynos5250_pin_ctrl,
562 	.num_ctrl	= ARRAY_SIZE(exynos5250_pin_ctrl),
563 };
564 
565 /* pin banks of exynos5260 pin-controller 0 */
566 static const struct samsung_pin_bank_data exynos5260_pin_banks0[] __initconst = {
567 	/* Must start with EINTG banks, ordered by EINT group number. */
568 	EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpa0", 0x00),
569 	EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpa1", 0x04),
570 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
571 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
572 	EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpb1", 0x10),
573 	EXYNOS_PIN_BANK_EINTG(5, 0x0a0, "gpb2", 0x14),
574 	EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpb3", 0x18),
575 	EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpb4", 0x1c),
576 	EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpb5", 0x20),
577 	EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpd0", 0x24),
578 	EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpd1", 0x28),
579 	EXYNOS_PIN_BANK_EINTG(5, 0x160, "gpd2", 0x2c),
580 	EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpe0", 0x30),
581 	EXYNOS_PIN_BANK_EINTG(5, 0x1a0, "gpe1", 0x34),
582 	EXYNOS_PIN_BANK_EINTG(4, 0x1c0, "gpf0", 0x38),
583 	EXYNOS_PIN_BANK_EINTG(8, 0x1e0, "gpf1", 0x3c),
584 	EXYNOS_PIN_BANK_EINTG(2, 0x200, "gpk0", 0x40),
585 	EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00),
586 	EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04),
587 	EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08),
588 	EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
589 };
590 
591 /* pin banks of exynos5260 pin-controller 1 */
592 static const struct samsung_pin_bank_data exynos5260_pin_banks1[] __initconst = {
593 	/* Must start with EINTG banks, ordered by EINT group number. */
594 	EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpc0", 0x00),
595 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpc1", 0x04),
596 	EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
597 	EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
598 	EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpc4", 0x10),
599 };
600 
601 /* pin banks of exynos5260 pin-controller 2 */
602 static const struct samsung_pin_bank_data exynos5260_pin_banks2[] __initconst = {
603 	/* Must start with EINTG banks, ordered by EINT group number. */
604 	EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
605 	EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
606 };
607 
608 /*
609  * Samsung pinctrl driver data for Exynos5260 SoC. Exynos5260 SoC includes
610  * three gpio/pin-mux/pinconfig controllers.
611  */
612 static const struct samsung_pin_ctrl exynos5260_pin_ctrl[] __initconst = {
613 	{
614 		/* pin-controller instance 0 data */
615 		.pin_banks	= exynos5260_pin_banks0,
616 		.nr_banks	= ARRAY_SIZE(exynos5260_pin_banks0),
617 		.eint_gpio_init = exynos_eint_gpio_init,
618 		.eint_wkup_init = exynos_eint_wkup_init,
619 	}, {
620 		/* pin-controller instance 1 data */
621 		.pin_banks	= exynos5260_pin_banks1,
622 		.nr_banks	= ARRAY_SIZE(exynos5260_pin_banks1),
623 		.eint_gpio_init = exynos_eint_gpio_init,
624 	}, {
625 		/* pin-controller instance 2 data */
626 		.pin_banks	= exynos5260_pin_banks2,
627 		.nr_banks	= ARRAY_SIZE(exynos5260_pin_banks2),
628 		.eint_gpio_init = exynos_eint_gpio_init,
629 	},
630 };
631 
632 const struct samsung_pinctrl_of_match_data exynos5260_of_data __initconst = {
633 	.ctrl		= exynos5260_pin_ctrl,
634 	.num_ctrl	= ARRAY_SIZE(exynos5260_pin_ctrl),
635 };
636 
637 /* pin banks of exynos5410 pin-controller 0 */
638 static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = {
639 	/* Must start with EINTG banks, ordered by EINT group number. */
640 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
641 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
642 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
643 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
644 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
645 	EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
646 	EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
647 	EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
648 	EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc3", 0x20),
649 	EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc1", 0x24),
650 	EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc2", 0x28),
651 	EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x2c),
652 	EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpe0", 0x30),
653 	EXYNOS_PIN_BANK_EINTG(2, 0x1C0, "gpe1", 0x34),
654 	EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf0", 0x38),
655 	EXYNOS_PIN_BANK_EINTG(8, 0x200, "gpf1", 0x3c),
656 	EXYNOS_PIN_BANK_EINTG(8, 0x220, "gpg0", 0x40),
657 	EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpg1", 0x44),
658 	EXYNOS_PIN_BANK_EINTG(2, 0x260, "gpg2", 0x48),
659 	EXYNOS_PIN_BANK_EINTG(4, 0x280, "gph0", 0x4c),
660 	EXYNOS_PIN_BANK_EINTG(8, 0x2A0, "gph1", 0x50),
661 	EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"),
662 	EXYNOS_PIN_BANK_EINTN(8, 0x2C0, "gpm7"),
663 	EXYNOS_PIN_BANK_EINTN(6, 0x2E0, "gpy0"),
664 	EXYNOS_PIN_BANK_EINTN(4, 0x300, "gpy1"),
665 	EXYNOS_PIN_BANK_EINTN(6, 0x320, "gpy2"),
666 	EXYNOS_PIN_BANK_EINTN(8, 0x340, "gpy3"),
667 	EXYNOS_PIN_BANK_EINTN(8, 0x360, "gpy4"),
668 	EXYNOS_PIN_BANK_EINTN(8, 0x380, "gpy5"),
669 	EXYNOS_PIN_BANK_EINTN(8, 0x3A0, "gpy6"),
670 	EXYNOS_PIN_BANK_EINTN(8, 0x3C0, "gpy7"),
671 	EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
672 	EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
673 	EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
674 	EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
675 };
676 
677 /* pin banks of exynos5410 pin-controller 1 */
678 static const struct samsung_pin_bank_data exynos5410_pin_banks1[] __initconst = {
679 	/* Must start with EINTG banks, ordered by EINT group number. */
680 	EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpj0", 0x00),
681 	EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpj1", 0x04),
682 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpj2", 0x08),
683 	EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpj3", 0x0c),
684 	EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpj4", 0x10),
685 	EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpk0", 0x14),
686 	EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpk1", 0x18),
687 	EXYNOS_PIN_BANK_EINTG(8, 0x0E0, "gpk2", 0x1c),
688 	EXYNOS_PIN_BANK_EINTG(7, 0x100, "gpk3", 0x20),
689 };
690 
691 /* pin banks of exynos5410 pin-controller 2 */
692 static const struct samsung_pin_bank_data exynos5410_pin_banks2[] __initconst = {
693 	/* Must start with EINTG banks, ordered by EINT group number. */
694 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
695 	EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
696 	EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
697 	EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
698 	EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
699 };
700 
701 /* pin banks of exynos5410 pin-controller 3 */
702 static const struct samsung_pin_bank_data exynos5410_pin_banks3[] __initconst = {
703 	/* Must start with EINTG banks, ordered by EINT group number. */
704 	EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
705 };
706 
707 /*
708  * Samsung pinctrl driver data for Exynos5410 SoC. Exynos5410 SoC includes
709  * four gpio/pin-mux/pinconfig controllers.
710  */
711 static const struct samsung_pin_ctrl exynos5410_pin_ctrl[] __initconst = {
712 	{
713 		/* pin-controller instance 0 data */
714 		.pin_banks	= exynos5410_pin_banks0,
715 		.nr_banks	= ARRAY_SIZE(exynos5410_pin_banks0),
716 		.eint_gpio_init = exynos_eint_gpio_init,
717 		.eint_wkup_init = exynos_eint_wkup_init,
718 		.suspend	= exynos_pinctrl_suspend,
719 		.resume		= exynos_pinctrl_resume,
720 	}, {
721 		/* pin-controller instance 1 data */
722 		.pin_banks	= exynos5410_pin_banks1,
723 		.nr_banks	= ARRAY_SIZE(exynos5410_pin_banks1),
724 		.eint_gpio_init = exynos_eint_gpio_init,
725 		.suspend	= exynos_pinctrl_suspend,
726 		.resume		= exynos_pinctrl_resume,
727 	}, {
728 		/* pin-controller instance 2 data */
729 		.pin_banks	= exynos5410_pin_banks2,
730 		.nr_banks	= ARRAY_SIZE(exynos5410_pin_banks2),
731 		.eint_gpio_init = exynos_eint_gpio_init,
732 		.suspend	= exynos_pinctrl_suspend,
733 		.resume		= exynos_pinctrl_resume,
734 	}, {
735 		/* pin-controller instance 3 data */
736 		.pin_banks	= exynos5410_pin_banks3,
737 		.nr_banks	= ARRAY_SIZE(exynos5410_pin_banks3),
738 		.eint_gpio_init = exynos_eint_gpio_init,
739 		.suspend	= exynos_pinctrl_suspend,
740 		.resume		= exynos_pinctrl_resume,
741 	},
742 };
743 
744 const struct samsung_pinctrl_of_match_data exynos5410_of_data __initconst = {
745 	.ctrl		= exynos5410_pin_ctrl,
746 	.num_ctrl	= ARRAY_SIZE(exynos5410_pin_ctrl),
747 };
748 
749 /* pin banks of exynos5420 pin-controller 0 */
750 static const struct samsung_pin_bank_data exynos5420_pin_banks0[] __initconst = {
751 	/* Must start with EINTG banks, ordered by EINT group number. */
752 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00),
753 	EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
754 	EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
755 	EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
756 	EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
757 };
758 
759 /* pin banks of exynos5420 pin-controller 1 */
760 static const struct samsung_pin_bank_data exynos5420_pin_banks1[] __initconst = {
761 	/* Must start with EINTG banks, ordered by EINT group number. */
762 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpc0", 0x00),
763 	EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc1", 0x04),
764 	EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
765 	EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
766 	EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpc4", 0x10),
767 	EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpd1", 0x14),
768 	EXYNOS_PIN_BANK_EINTN(6, 0x0C0, "gpy0"),
769 	EXYNOS_PIN_BANK_EINTN(4, 0x0E0, "gpy1"),
770 	EXYNOS_PIN_BANK_EINTN(6, 0x100, "gpy2"),
771 	EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpy3"),
772 	EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpy4"),
773 	EXYNOS_PIN_BANK_EINTN(8, 0x160, "gpy5"),
774 	EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy6"),
775 };
776 
777 /* pin banks of exynos5420 pin-controller 2 */
778 static const struct samsung_pin_bank_data exynos5420_pin_banks2[] __initconst = {
779 	/* Must start with EINTG banks, ordered by EINT group number. */
780 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
781 	EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
782 	EXYNOS_PIN_BANK_EINTG(6, 0x040, "gpf0", 0x08),
783 	EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpf1", 0x0c),
784 	EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
785 	EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
786 	EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
787 	EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gpj4", 0x1c),
788 };
789 
790 /* pin banks of exynos5420 pin-controller 3 */
791 static const struct samsung_pin_bank_data exynos5420_pin_banks3[] __initconst = {
792 	/* Must start with EINTG banks, ordered by EINT group number. */
793 	EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
794 	EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
795 	EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
796 	EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
797 	EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
798 	EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
799 	EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpb3", 0x18),
800 	EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpb4", 0x1c),
801 	EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph0", 0x20),
802 };
803 
804 /* pin banks of exynos5420 pin-controller 4 */
805 static const struct samsung_pin_bank_data exynos5420_pin_banks4[] __initconst = {
806 	/* Must start with EINTG banks, ordered by EINT group number. */
807 	EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
808 };
809 
810 /* PMU pad retention groups registers for Exynos5420 (without audio) */
811 static const u32 exynos5420_retention_regs[] = {
812 	EXYNOS_PAD_RET_DRAM_OPTION,
813 	EXYNOS_PAD_RET_JTAG_OPTION,
814 	EXYNOS5420_PAD_RET_GPIO_OPTION,
815 	EXYNOS5420_PAD_RET_UART_OPTION,
816 	EXYNOS5420_PAD_RET_MMCA_OPTION,
817 	EXYNOS5420_PAD_RET_MMCB_OPTION,
818 	EXYNOS5420_PAD_RET_MMCC_OPTION,
819 	EXYNOS5420_PAD_RET_HSI_OPTION,
820 	EXYNOS_PAD_RET_EBIA_OPTION,
821 	EXYNOS_PAD_RET_EBIB_OPTION,
822 	EXYNOS5420_PAD_RET_SPI_OPTION,
823 	EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION,
824 };
825 
826 static const struct samsung_retention_data exynos5420_retention_data __initconst = {
827 	.regs	 = exynos5420_retention_regs,
828 	.nr_regs = ARRAY_SIZE(exynos5420_retention_regs),
829 	.value	 = EXYNOS_WAKEUP_FROM_LOWPWR,
830 	.refcnt	 = &exynos_shared_retention_refcnt,
831 	.init	 = exynos_retention_init,
832 };
833 
834 /*
835  * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes
836  * four gpio/pin-mux/pinconfig controllers.
837  */
838 static const struct samsung_pin_ctrl exynos5420_pin_ctrl[] __initconst = {
839 	{
840 		/* pin-controller instance 0 data */
841 		.pin_banks	= exynos5420_pin_banks0,
842 		.nr_banks	= ARRAY_SIZE(exynos5420_pin_banks0),
843 		.eint_gpio_init = exynos_eint_gpio_init,
844 		.eint_wkup_init = exynos_eint_wkup_init,
845 		.retention_data	= &exynos5420_retention_data,
846 	}, {
847 		/* pin-controller instance 1 data */
848 		.pin_banks	= exynos5420_pin_banks1,
849 		.nr_banks	= ARRAY_SIZE(exynos5420_pin_banks1),
850 		.eint_gpio_init = exynos_eint_gpio_init,
851 		.retention_data	= &exynos5420_retention_data,
852 	}, {
853 		/* pin-controller instance 2 data */
854 		.pin_banks	= exynos5420_pin_banks2,
855 		.nr_banks	= ARRAY_SIZE(exynos5420_pin_banks2),
856 		.eint_gpio_init = exynos_eint_gpio_init,
857 		.retention_data	= &exynos5420_retention_data,
858 	}, {
859 		/* pin-controller instance 3 data */
860 		.pin_banks	= exynos5420_pin_banks3,
861 		.nr_banks	= ARRAY_SIZE(exynos5420_pin_banks3),
862 		.eint_gpio_init = exynos_eint_gpio_init,
863 		.retention_data	= &exynos5420_retention_data,
864 	}, {
865 		/* pin-controller instance 4 data */
866 		.pin_banks	= exynos5420_pin_banks4,
867 		.nr_banks	= ARRAY_SIZE(exynos5420_pin_banks4),
868 		.eint_gpio_init = exynos_eint_gpio_init,
869 		.retention_data	= &exynos4_audio_retention_data,
870 	},
871 };
872 
873 const struct samsung_pinctrl_of_match_data exynos5420_of_data __initconst = {
874 	.ctrl		= exynos5420_pin_ctrl,
875 	.num_ctrl	= ARRAY_SIZE(exynos5420_pin_ctrl),
876 };
877