]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/pinctrl/pinctrl-exynos.c
pinctrl: samsung: Handle GPIO request and free using pinctrl helpers
[mirror_ubuntu-artful-kernel.git] / drivers / pinctrl / pinctrl-exynos.c
CommitLineData
43b169db
TA
1/*
2 * Exynos specific support for Samsung pinctrl/gpiolib driver with eint support.
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * Copyright (c) 2012 Linaro Ltd
7 * http://www.linaro.org
8 *
9 * Author: Thomas Abraham <thomas.ab@samsung.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This file contains the Samsung Exynos specific information required by the
17 * the Samsung pinctrl/gpiolib driver. It also includes the implementation of
18 * external gpio and wakeup interrupt support.
19 */
20
21#include <linux/module.h>
22#include <linux/device.h>
23#include <linux/interrupt.h>
24#include <linux/irqdomain.h>
25#include <linux/irq.h>
de88cbb7 26#include <linux/irqchip/chained_irq.h>
43b169db
TA
27#include <linux/of_irq.h>
28#include <linux/io.h>
29#include <linux/slab.h>
19846950 30#include <linux/spinlock.h>
43b169db
TA
31#include <linux/err.h>
32
43b169db
TA
33#include "pinctrl-samsung.h"
34#include "pinctrl-exynos.h"
35
499147c9
TF
36
37static struct samsung_pin_bank_type bank_type_off = {
38 .fld_width = { 4, 1, 2, 2, 2, 2, },
43fc9e7f 39 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
499147c9
TF
40};
41
42static struct samsung_pin_bank_type bank_type_alive = {
43 .fld_width = { 4, 1, 2, 2, },
43fc9e7f 44 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
499147c9
TF
45};
46
43b169db
TA
47/* list of external wakeup controllers supported */
48static const struct of_device_id exynos_wkup_irq_ids[] = {
49 { .compatible = "samsung,exynos4210-wakeup-eint", },
afa538c2 50 { }
43b169db
TA
51};
52
5ace03fb 53static void exynos_gpio_irq_mask(struct irq_data *irqd)
43b169db 54{
595be726
TF
55 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
56 struct samsung_pinctrl_drv_data *d = bank->drvdata;
57 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
43b169db 58 unsigned long mask;
5ae8cf79
DA
59 unsigned long flags;
60
61 spin_lock_irqsave(&bank->slock, flags);
43b169db
TA
62
63 mask = readl(d->virt_base + reg_mask);
5ace03fb 64 mask |= 1 << irqd->hwirq;
43b169db 65 writel(mask, d->virt_base + reg_mask);
5ae8cf79
DA
66
67 spin_unlock_irqrestore(&bank->slock, flags);
43b169db
TA
68}
69
5ace03fb 70static void exynos_gpio_irq_ack(struct irq_data *irqd)
43b169db 71{
595be726
TF
72 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
73 struct samsung_pinctrl_drv_data *d = bank->drvdata;
5ace03fb 74 unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
43b169db 75
5ace03fb 76 writel(1 << irqd->hwirq, d->virt_base + reg_pend);
43b169db
TA
77}
78
5ace03fb 79static void exynos_gpio_irq_unmask(struct irq_data *irqd)
43b169db 80{
595be726
TF
81 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
82 struct samsung_pinctrl_drv_data *d = bank->drvdata;
595be726 83 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
43b169db 84 unsigned long mask;
5ae8cf79 85 unsigned long flags;
43b169db 86
5a68e7a7
DA
87 /*
88 * Ack level interrupts right before unmask
89 *
90 * If we don't do this we'll get a double-interrupt. Level triggered
91 * interrupts must not fire an interrupt if the level is not
92 * _currently_ active, even if it was active while the interrupt was
93 * masked.
94 */
95 if (irqd_get_trigger_type(irqd) & IRQ_TYPE_LEVEL_MASK)
96 exynos_gpio_irq_ack(irqd);
97
5ae8cf79 98 spin_lock_irqsave(&bank->slock, flags);
43b169db
TA
99
100 mask = readl(d->virt_base + reg_mask);
5ace03fb 101 mask &= ~(1 << irqd->hwirq);
43b169db 102 writel(mask, d->virt_base + reg_mask);
5ae8cf79
DA
103
104 spin_unlock_irqrestore(&bank->slock, flags);
43b169db
TA
105}
106
107static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
108{
595be726 109 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
499147c9 110 struct samsung_pin_bank_type *bank_type = bank->type;
595be726 111 struct samsung_pinctrl_drv_data *d = bank->drvdata;
43b169db 112 struct samsung_pin_ctrl *ctrl = d->ctrl;
595be726
TF
113 unsigned int pin = irqd->hwirq;
114 unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
43b169db 115 unsigned int con, trig_type;
595be726 116 unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
19846950 117 unsigned long flags;
ee2f573c 118 unsigned int mask;
43b169db
TA
119
120 switch (type) {
121 case IRQ_TYPE_EDGE_RISING:
122 trig_type = EXYNOS_EINT_EDGE_RISING;
123 break;
124 case IRQ_TYPE_EDGE_FALLING:
125 trig_type = EXYNOS_EINT_EDGE_FALLING;
126 break;
127 case IRQ_TYPE_EDGE_BOTH:
128 trig_type = EXYNOS_EINT_EDGE_BOTH;
129 break;
130 case IRQ_TYPE_LEVEL_HIGH:
131 trig_type = EXYNOS_EINT_LEVEL_HIGH;
132 break;
133 case IRQ_TYPE_LEVEL_LOW:
134 trig_type = EXYNOS_EINT_LEVEL_LOW;
135 break;
136 default:
137 pr_err("unsupported external interrupt type\n");
138 return -EINVAL;
139 }
140
141 if (type & IRQ_TYPE_EDGE_BOTH)
142 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
143 else
144 __irq_set_handler_locked(irqd->irq, handle_level_irq);
145
146 con = readl(d->virt_base + reg_con);
147 con &= ~(EXYNOS_EINT_CON_MASK << shift);
148 con |= trig_type << shift;
149 writel(con, d->virt_base + reg_con);
ee2f573c 150
43fc9e7f 151 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
499147c9
TF
152 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
153 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
ee2f573c 154
19846950
TF
155 spin_lock_irqsave(&bank->slock, flags);
156
ee2f573c
TF
157 con = readl(d->virt_base + reg_con);
158 con &= ~(mask << shift);
159 con |= EXYNOS_EINT_FUNC << shift;
160 writel(con, d->virt_base + reg_con);
161
19846950
TF
162 spin_unlock_irqrestore(&bank->slock, flags);
163
43b169db
TA
164 return 0;
165}
166
167/*
168 * irq_chip for gpio interrupts.
169 */
170static struct irq_chip exynos_gpio_irq_chip = {
171 .name = "exynos_gpio_irq_chip",
172 .irq_unmask = exynos_gpio_irq_unmask,
173 .irq_mask = exynos_gpio_irq_mask,
174 .irq_ack = exynos_gpio_irq_ack,
175 .irq_set_type = exynos_gpio_irq_set_type,
176};
177
43b169db
TA
178static int exynos_gpio_irq_map(struct irq_domain *h, unsigned int virq,
179 irq_hw_number_t hw)
180{
595be726 181 struct samsung_pin_bank *b = h->host_data;
43b169db 182
595be726 183 irq_set_chip_data(virq, b);
43b169db
TA
184 irq_set_chip_and_handler(virq, &exynos_gpio_irq_chip,
185 handle_level_irq);
186 set_irq_flags(virq, IRQF_VALID);
187 return 0;
188}
189
43b169db
TA
190/*
191 * irq domain callbacks for external gpio interrupt controller.
192 */
193static const struct irq_domain_ops exynos_gpio_irqd_ops = {
194 .map = exynos_gpio_irq_map,
43b169db
TA
195 .xlate = irq_domain_xlate_twocell,
196};
197
198static irqreturn_t exynos_eint_gpio_irq(int irq, void *data)
199{
200 struct samsung_pinctrl_drv_data *d = data;
201 struct samsung_pin_ctrl *ctrl = d->ctrl;
202 struct samsung_pin_bank *bank = ctrl->pin_banks;
203 unsigned int svc, group, pin, virq;
204
205 svc = readl(d->virt_base + ctrl->svc);
206 group = EXYNOS_SVC_GROUP(svc);
207 pin = svc & EXYNOS_SVC_NUM_MASK;
208
209 if (!group)
210 return IRQ_HANDLED;
211 bank += (group - 1);
212
595be726 213 virq = irq_linear_revmap(bank->irq_domain, pin);
43b169db
TA
214 if (!virq)
215 return IRQ_NONE;
216 generic_handle_irq(virq);
217 return IRQ_HANDLED;
218}
219
7ccbc60c
TF
220struct exynos_eint_gpio_save {
221 u32 eint_con;
222 u32 eint_fltcon0;
223 u32 eint_fltcon1;
224};
225
43b169db
TA
226/*
227 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
228 * @d: driver data of samsung pinctrl driver.
229 */
230static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
231{
595be726 232 struct samsung_pin_bank *bank;
43b169db 233 struct device *dev = d->dev;
7ccbc60c
TF
234 int ret;
235 int i;
43b169db
TA
236
237 if (!d->irq) {
238 dev_err(dev, "irq number not available\n");
239 return -EINVAL;
240 }
241
242 ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
243 0, dev_name(dev), d);
244 if (ret) {
245 dev_err(dev, "irq request failed\n");
246 return -ENXIO;
247 }
248
595be726
TF
249 bank = d->ctrl->pin_banks;
250 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
251 if (bank->eint_type != EINT_TYPE_GPIO)
252 continue;
253 bank->irq_domain = irq_domain_add_linear(bank->of_node,
254 bank->nr_pins, &exynos_gpio_irqd_ops, bank);
255 if (!bank->irq_domain) {
256 dev_err(dev, "gpio irq domain add failed\n");
7ccbc60c
TF
257 ret = -ENXIO;
258 goto err_domains;
259 }
260
261 bank->soc_priv = devm_kzalloc(d->dev,
262 sizeof(struct exynos_eint_gpio_save), GFP_KERNEL);
263 if (!bank->soc_priv) {
264 irq_domain_remove(bank->irq_domain);
265 ret = -ENOMEM;
266 goto err_domains;
595be726 267 }
43b169db
TA
268 }
269
270 return 0;
7ccbc60c
TF
271
272err_domains:
273 for (--i, --bank; i >= 0; --i, --bank) {
274 if (bank->eint_type != EINT_TYPE_GPIO)
275 continue;
276 irq_domain_remove(bank->irq_domain);
277 }
278
279 return ret;
43b169db
TA
280}
281
5ace03fb 282static void exynos_wkup_irq_mask(struct irq_data *irqd)
43b169db 283{
a04b07c0
TF
284 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
285 struct samsung_pinctrl_drv_data *d = b->drvdata;
286 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
43b169db 287 unsigned long mask;
5ae8cf79
DA
288 unsigned long flags;
289
290 spin_lock_irqsave(&b->slock, flags);
43b169db
TA
291
292 mask = readl(d->virt_base + reg_mask);
5ace03fb 293 mask |= 1 << irqd->hwirq;
43b169db 294 writel(mask, d->virt_base + reg_mask);
5ae8cf79
DA
295
296 spin_unlock_irqrestore(&b->slock, flags);
43b169db
TA
297}
298
5ace03fb 299static void exynos_wkup_irq_ack(struct irq_data *irqd)
43b169db 300{
a04b07c0
TF
301 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
302 struct samsung_pinctrl_drv_data *d = b->drvdata;
5ace03fb 303 unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
43b169db 304
5ace03fb 305 writel(1 << irqd->hwirq, d->virt_base + pend);
43b169db
TA
306}
307
5ace03fb 308static void exynos_wkup_irq_unmask(struct irq_data *irqd)
43b169db 309{
a04b07c0
TF
310 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
311 struct samsung_pinctrl_drv_data *d = b->drvdata;
a04b07c0 312 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
43b169db 313 unsigned long mask;
5ae8cf79 314 unsigned long flags;
43b169db 315
5a68e7a7
DA
316 /*
317 * Ack level interrupts right before unmask
318 *
319 * If we don't do this we'll get a double-interrupt. Level triggered
320 * interrupts must not fire an interrupt if the level is not
321 * _currently_ active, even if it was active while the interrupt was
322 * masked.
323 */
324 if (irqd_get_trigger_type(irqd) & IRQ_TYPE_LEVEL_MASK)
325 exynos_wkup_irq_ack(irqd);
326
5ae8cf79 327 spin_lock_irqsave(&b->slock, flags);
43b169db
TA
328
329 mask = readl(d->virt_base + reg_mask);
5ace03fb 330 mask &= ~(1 << irqd->hwirq);
43b169db 331 writel(mask, d->virt_base + reg_mask);
5ae8cf79
DA
332
333 spin_unlock_irqrestore(&b->slock, flags);
43b169db
TA
334}
335
336static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
337{
a04b07c0 338 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
499147c9 339 struct samsung_pin_bank_type *bank_type = bank->type;
a04b07c0
TF
340 struct samsung_pinctrl_drv_data *d = bank->drvdata;
341 unsigned int pin = irqd->hwirq;
342 unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
43b169db
TA
343 unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
344 unsigned long con, trig_type;
19846950 345 unsigned long flags;
22b9ba03 346 unsigned int mask;
43b169db
TA
347
348 switch (type) {
349 case IRQ_TYPE_EDGE_RISING:
350 trig_type = EXYNOS_EINT_EDGE_RISING;
351 break;
352 case IRQ_TYPE_EDGE_FALLING:
353 trig_type = EXYNOS_EINT_EDGE_FALLING;
354 break;
355 case IRQ_TYPE_EDGE_BOTH:
356 trig_type = EXYNOS_EINT_EDGE_BOTH;
357 break;
358 case IRQ_TYPE_LEVEL_HIGH:
359 trig_type = EXYNOS_EINT_LEVEL_HIGH;
360 break;
361 case IRQ_TYPE_LEVEL_LOW:
362 trig_type = EXYNOS_EINT_LEVEL_LOW;
363 break;
364 default:
365 pr_err("unsupported external interrupt type\n");
366 return -EINVAL;
367 }
368
369 if (type & IRQ_TYPE_EDGE_BOTH)
370 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
371 else
372 __irq_set_handler_locked(irqd->irq, handle_level_irq);
373
374 con = readl(d->virt_base + reg_con);
375 con &= ~(EXYNOS_EINT_CON_MASK << shift);
376 con |= trig_type << shift;
377 writel(con, d->virt_base + reg_con);
22b9ba03 378
43fc9e7f 379 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
499147c9
TF
380 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
381 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
22b9ba03 382
19846950
TF
383 spin_lock_irqsave(&bank->slock, flags);
384
22b9ba03
TF
385 con = readl(d->virt_base + reg_con);
386 con &= ~(mask << shift);
387 con |= EXYNOS_EINT_FUNC << shift;
388 writel(con, d->virt_base + reg_con);
389
19846950
TF
390 spin_unlock_irqrestore(&bank->slock, flags);
391
43b169db
TA
392 return 0;
393}
394
ad350cd9
TF
395static u32 exynos_eint_wake_mask = 0xffffffff;
396
397u32 exynos_get_eint_wake_mask(void)
398{
399 return exynos_eint_wake_mask;
400}
401
402static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on)
403{
404 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
405 unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq);
406
407 pr_info("wake %s for irq %d\n", on ? "enabled" : "disabled", irqd->irq);
408
409 if (!on)
410 exynos_eint_wake_mask |= bit;
411 else
412 exynos_eint_wake_mask &= ~bit;
413
414 return 0;
415}
416
43b169db
TA
417/*
418 * irq_chip for wakeup interrupts
419 */
420static struct irq_chip exynos_wkup_irq_chip = {
421 .name = "exynos_wkup_irq_chip",
422 .irq_unmask = exynos_wkup_irq_unmask,
423 .irq_mask = exynos_wkup_irq_mask,
424 .irq_ack = exynos_wkup_irq_ack,
425 .irq_set_type = exynos_wkup_irq_set_type,
ad350cd9 426 .irq_set_wake = exynos_wkup_irq_set_wake,
43b169db
TA
427};
428
429/* interrupt handler for wakeup interrupts 0..15 */
430static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
431{
432 struct exynos_weint_data *eintd = irq_get_handler_data(irq);
a04b07c0 433 struct samsung_pin_bank *bank = eintd->bank;
43b169db
TA
434 struct irq_chip *chip = irq_get_chip(irq);
435 int eint_irq;
436
437 chained_irq_enter(chip, desc);
438 chip->irq_mask(&desc->irq_data);
439
440 if (chip->irq_ack)
441 chip->irq_ack(&desc->irq_data);
442
a04b07c0 443 eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
43b169db
TA
444 generic_handle_irq(eint_irq);
445 chip->irq_unmask(&desc->irq_data);
446 chained_irq_exit(chip, desc);
447}
448
a04b07c0
TF
449static inline void exynos_irq_demux_eint(unsigned long pend,
450 struct irq_domain *domain)
43b169db
TA
451{
452 unsigned int irq;
453
454 while (pend) {
455 irq = fls(pend) - 1;
a04b07c0 456 generic_handle_irq(irq_find_mapping(domain, irq));
43b169db
TA
457 pend &= ~(1 << irq);
458 }
459}
460
461/* interrupt handler for wakeup interrupt 16 */
462static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
463{
464 struct irq_chip *chip = irq_get_chip(irq);
a04b07c0
TF
465 struct exynos_muxed_weint_data *eintd = irq_get_handler_data(irq);
466 struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata;
467 struct samsung_pin_ctrl *ctrl = d->ctrl;
43b169db 468 unsigned long pend;
de59049b 469 unsigned long mask;
a04b07c0 470 int i;
43b169db
TA
471
472 chained_irq_enter(chip, desc);
a04b07c0
TF
473
474 for (i = 0; i < eintd->nr_banks; ++i) {
475 struct samsung_pin_bank *b = eintd->banks[i];
476 pend = readl(d->virt_base + ctrl->weint_pend + b->eint_offset);
477 mask = readl(d->virt_base + ctrl->weint_mask + b->eint_offset);
478 exynos_irq_demux_eint(pend & ~mask, b->irq_domain);
479 }
480
43b169db
TA
481 chained_irq_exit(chip, desc);
482}
483
484static int exynos_wkup_irq_map(struct irq_domain *h, unsigned int virq,
485 irq_hw_number_t hw)
486{
487 irq_set_chip_and_handler(virq, &exynos_wkup_irq_chip, handle_level_irq);
488 irq_set_chip_data(virq, h->host_data);
489 set_irq_flags(virq, IRQF_VALID);
490 return 0;
491}
492
493/*
494 * irq domain callbacks for external wakeup interrupt controller.
495 */
496static const struct irq_domain_ops exynos_wkup_irqd_ops = {
497 .map = exynos_wkup_irq_map,
498 .xlate = irq_domain_xlate_twocell,
499};
500
501/*
502 * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
503 * @d: driver data of samsung pinctrl driver.
504 */
505static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
506{
507 struct device *dev = d->dev;
c3ad056b
TF
508 struct device_node *wkup_np = NULL;
509 struct device_node *np;
a04b07c0 510 struct samsung_pin_bank *bank;
43b169db 511 struct exynos_weint_data *weint_data;
a04b07c0
TF
512 struct exynos_muxed_weint_data *muxed_data;
513 unsigned int muxed_banks = 0;
514 unsigned int i;
43b169db
TA
515 int idx, irq;
516
c3ad056b
TF
517 for_each_child_of_node(dev->of_node, np) {
518 if (of_match_node(exynos_wkup_irq_ids, np)) {
519 wkup_np = np;
520 break;
521 }
43b169db 522 }
c3ad056b
TF
523 if (!wkup_np)
524 return -ENODEV;
43b169db 525
a04b07c0
TF
526 bank = d->ctrl->pin_banks;
527 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
528 if (bank->eint_type != EINT_TYPE_WKUP)
529 continue;
43b169db 530
a04b07c0
TF
531 bank->irq_domain = irq_domain_add_linear(bank->of_node,
532 bank->nr_pins, &exynos_wkup_irqd_ops, bank);
533 if (!bank->irq_domain) {
534 dev_err(dev, "wkup irq domain add failed\n");
535 return -ENXIO;
536 }
43b169db 537
a04b07c0
TF
538 if (!of_find_property(bank->of_node, "interrupts", NULL)) {
539 bank->eint_type = EINT_TYPE_WKUP_MUX;
540 ++muxed_banks;
541 continue;
542 }
43b169db 543
a04b07c0
TF
544 weint_data = devm_kzalloc(dev, bank->nr_pins
545 * sizeof(*weint_data), GFP_KERNEL);
546 if (!weint_data) {
547 dev_err(dev, "could not allocate memory for weint_data\n");
548 return -ENOMEM;
549 }
43b169db 550
a04b07c0
TF
551 for (idx = 0; idx < bank->nr_pins; ++idx) {
552 irq = irq_of_parse_and_map(bank->of_node, idx);
553 if (!irq) {
554 dev_err(dev, "irq number for eint-%s-%d not found\n",
555 bank->name, idx);
556 continue;
557 }
558 weint_data[idx].irq = idx;
559 weint_data[idx].bank = bank;
43b169db
TA
560 irq_set_handler_data(irq, &weint_data[idx]);
561 irq_set_chained_handler(irq, exynos_irq_eint0_15);
43b169db
TA
562 }
563 }
a04b07c0
TF
564
565 if (!muxed_banks)
566 return 0;
567
568 irq = irq_of_parse_and_map(wkup_np, 0);
569 if (!irq) {
570 dev_err(dev, "irq number for muxed EINTs not found\n");
571 return 0;
572 }
573
574 muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
575 + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
576 if (!muxed_data) {
577 dev_err(dev, "could not allocate memory for muxed_data\n");
578 return -ENOMEM;
579 }
580
581 irq_set_chained_handler(irq, exynos_irq_demux_eint16_31);
582 irq_set_handler_data(irq, muxed_data);
583
584 bank = d->ctrl->pin_banks;
585 idx = 0;
586 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
587 if (bank->eint_type != EINT_TYPE_WKUP_MUX)
588 continue;
589
590 muxed_data->banks[idx++] = bank;
591 }
592 muxed_data->nr_banks = muxed_banks;
593
43b169db
TA
594 return 0;
595}
596
7ccbc60c
TF
597static void exynos_pinctrl_suspend_bank(
598 struct samsung_pinctrl_drv_data *drvdata,
599 struct samsung_pin_bank *bank)
600{
601 struct exynos_eint_gpio_save *save = bank->soc_priv;
602 void __iomem *regs = drvdata->virt_base;
603
604 save->eint_con = readl(regs + EXYNOS_GPIO_ECON_OFFSET
605 + bank->eint_offset);
606 save->eint_fltcon0 = readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET
607 + 2 * bank->eint_offset);
608 save->eint_fltcon1 = readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET
609 + 2 * bank->eint_offset + 4);
610
611 pr_debug("%s: save con %#010x\n", bank->name, save->eint_con);
612 pr_debug("%s: save fltcon0 %#010x\n", bank->name, save->eint_fltcon0);
613 pr_debug("%s: save fltcon1 %#010x\n", bank->name, save->eint_fltcon1);
614}
615
616static void exynos_pinctrl_suspend(struct samsung_pinctrl_drv_data *drvdata)
617{
618 struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
619 struct samsung_pin_bank *bank = ctrl->pin_banks;
620 int i;
621
622 for (i = 0; i < ctrl->nr_banks; ++i, ++bank)
623 if (bank->eint_type == EINT_TYPE_GPIO)
624 exynos_pinctrl_suspend_bank(drvdata, bank);
625}
626
627static void exynos_pinctrl_resume_bank(
628 struct samsung_pinctrl_drv_data *drvdata,
629 struct samsung_pin_bank *bank)
630{
631 struct exynos_eint_gpio_save *save = bank->soc_priv;
632 void __iomem *regs = drvdata->virt_base;
633
634 pr_debug("%s: con %#010x => %#010x\n", bank->name,
635 readl(regs + EXYNOS_GPIO_ECON_OFFSET
636 + bank->eint_offset), save->eint_con);
637 pr_debug("%s: fltcon0 %#010x => %#010x\n", bank->name,
638 readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET
639 + 2 * bank->eint_offset), save->eint_fltcon0);
640 pr_debug("%s: fltcon1 %#010x => %#010x\n", bank->name,
641 readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET
642 + 2 * bank->eint_offset + 4), save->eint_fltcon1);
643
644 writel(save->eint_con, regs + EXYNOS_GPIO_ECON_OFFSET
645 + bank->eint_offset);
646 writel(save->eint_fltcon0, regs + EXYNOS_GPIO_EFLTCON_OFFSET
647 + 2 * bank->eint_offset);
648 writel(save->eint_fltcon1, regs + EXYNOS_GPIO_EFLTCON_OFFSET
649 + 2 * bank->eint_offset + 4);
650}
651
652static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata)
653{
654 struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
655 struct samsung_pin_bank *bank = ctrl->pin_banks;
656 int i;
657
658 for (i = 0; i < ctrl->nr_banks; ++i, ++bank)
659 if (bank->eint_type == EINT_TYPE_GPIO)
660 exynos_pinctrl_resume_bank(drvdata, bank);
661}
662
608a26a7
MK
663/* pin banks of s5pv210 pin-controller */
664static struct samsung_pin_bank s5pv210_pin_bank[] = {
665 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
48802925 666 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
608a26a7
MK
667 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
668 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
669 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
670 EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
48802925
MK
671 EXYNOS_PIN_BANK_EINTG(6, 0x0c0, "gpd1", 0x18),
672 EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe0", 0x1c),
673 EXYNOS_PIN_BANK_EINTG(5, 0x100, "gpe1", 0x20),
674 EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpf0", 0x24),
608a26a7
MK
675 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28),
676 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c),
48802925 677 EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30),
608a26a7
MK
678 EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34),
679 EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38),
680 EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c),
681 EXYNOS_PIN_BANK_EINTG(7, 0x200, "gpg3", 0x40),
682 EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"),
683 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x44),
684 EXYNOS_PIN_BANK_EINTG(6, 0x260, "gpj1", 0x48),
685 EXYNOS_PIN_BANK_EINTG(8, 0x280, "gpj2", 0x4c),
686 EXYNOS_PIN_BANK_EINTG(8, 0x2a0, "gpj3", 0x50),
687 EXYNOS_PIN_BANK_EINTG(5, 0x2c0, "gpj4", 0x54),
688 EXYNOS_PIN_BANK_EINTN(8, 0x2e0, "mp01"),
689 EXYNOS_PIN_BANK_EINTN(4, 0x300, "mp02"),
690 EXYNOS_PIN_BANK_EINTN(8, 0x320, "mp03"),
691 EXYNOS_PIN_BANK_EINTN(8, 0x340, "mp04"),
692 EXYNOS_PIN_BANK_EINTN(8, 0x360, "mp05"),
693 EXYNOS_PIN_BANK_EINTN(8, 0x380, "mp06"),
694 EXYNOS_PIN_BANK_EINTN(8, 0x3a0, "mp07"),
695 EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gph0", 0x00),
696 EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gph1", 0x04),
697 EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gph2", 0x08),
698 EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gph3", 0x0c),
699};
700
701struct samsung_pin_ctrl s5pv210_pin_ctrl[] = {
702 {
703 /* pin-controller instance 0 data */
704 .pin_banks = s5pv210_pin_bank,
705 .nr_banks = ARRAY_SIZE(s5pv210_pin_bank),
706 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
707 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
708 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
709 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
710 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
711 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
712 .svc = EXYNOS_SVC_OFFSET,
713 .eint_gpio_init = exynos_eint_gpio_init,
714 .eint_wkup_init = exynos_eint_wkup_init,
715 .suspend = exynos_pinctrl_suspend,
716 .resume = exynos_pinctrl_resume,
717 .label = "s5pv210-gpio-ctrl0",
718 },
719};
720
d97f5b98
TF
721/* pin banks of exynos3250 pin-controller 0 */
722static struct samsung_pin_bank exynos3250_pin_banks0[] = {
723 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
724 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
725 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
726 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
727 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
728 EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
729 EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18),
730};
731
732/* pin banks of exynos3250 pin-controller 1 */
733static struct samsung_pin_bank exynos3250_pin_banks1[] = {
734 EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"),
735 EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"),
736 EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"),
737 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpk0", 0x08),
738 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
739 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
740 EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpl0", 0x18),
741 EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
742 EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
743 EXYNOS_PIN_BANK_EINTG(5, 0x2a0, "gpm2", 0x2c),
744 EXYNOS_PIN_BANK_EINTG(8, 0x2c0, "gpm3", 0x30),
745 EXYNOS_PIN_BANK_EINTG(8, 0x2e0, "gpm4", 0x34),
746 EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00),
747 EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04),
748 EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08),
749 EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
750};
751
752/*
753 * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes
754 * two gpio/pin-mux/pinconfig controllers.
755 */
756struct samsung_pin_ctrl exynos3250_pin_ctrl[] = {
757 {
758 /* pin-controller instance 0 data */
759 .pin_banks = exynos3250_pin_banks0,
760 .nr_banks = ARRAY_SIZE(exynos3250_pin_banks0),
761 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
762 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
763 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
764 .svc = EXYNOS_SVC_OFFSET,
765 .eint_gpio_init = exynos_eint_gpio_init,
766 .suspend = exynos_pinctrl_suspend,
767 .resume = exynos_pinctrl_resume,
768 .label = "exynos3250-gpio-ctrl0",
769 }, {
770 /* pin-controller instance 1 data */
771 .pin_banks = exynos3250_pin_banks1,
772 .nr_banks = ARRAY_SIZE(exynos3250_pin_banks1),
773 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
774 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
775 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
776 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
777 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
778 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
779 .svc = EXYNOS_SVC_OFFSET,
780 .eint_gpio_init = exynos_eint_gpio_init,
781 .eint_wkup_init = exynos_eint_wkup_init,
782 .suspend = exynos_pinctrl_suspend,
783 .resume = exynos_pinctrl_resume,
784 .label = "exynos3250-gpio-ctrl1",
785 },
786};
787
43b169db
TA
788/* pin banks of exynos4210 pin-controller 0 */
789static struct samsung_pin_bank exynos4210_pin_banks0[] = {
1b6056d6
TF
790 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
791 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
792 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
793 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
794 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
795 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
796 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
797 EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
798 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
799 EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
800 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
801 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
802 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
803 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
804 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
805 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
43b169db
TA
806};
807
808/* pin banks of exynos4210 pin-controller 1 */
809static struct samsung_pin_bank exynos4210_pin_banks1[] = {
1b6056d6
TF
810 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
811 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
812 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
813 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
814 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
815 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
816 EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
817 EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
818 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
40ba6227
TF
819 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
820 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
821 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
822 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
823 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
824 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
825 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
a04b07c0
TF
826 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
827 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
828 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
829 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
43b169db
TA
830};
831
832/* pin banks of exynos4210 pin-controller 2 */
833static struct samsung_pin_bank exynos4210_pin_banks2[] = {
40ba6227 834 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
43b169db
TA
835};
836
837/*
838 * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
839 * three gpio/pin-mux/pinconfig controllers.
840 */
841struct samsung_pin_ctrl exynos4210_pin_ctrl[] = {
842 {
843 /* pin-controller instance 0 data */
844 .pin_banks = exynos4210_pin_banks0,
845 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
43b169db
TA
846 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
847 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
848 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
849 .svc = EXYNOS_SVC_OFFSET,
850 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
851 .suspend = exynos_pinctrl_suspend,
852 .resume = exynos_pinctrl_resume,
43b169db
TA
853 .label = "exynos4210-gpio-ctrl0",
854 }, {
855 /* pin-controller instance 1 data */
856 .pin_banks = exynos4210_pin_banks1,
857 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
43b169db
TA
858 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
859 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
860 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
861 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
862 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
863 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
864 .svc = EXYNOS_SVC_OFFSET,
865 .eint_gpio_init = exynos_eint_gpio_init,
866 .eint_wkup_init = exynos_eint_wkup_init,
7ccbc60c
TF
867 .suspend = exynos_pinctrl_suspend,
868 .resume = exynos_pinctrl_resume,
43b169db
TA
869 .label = "exynos4210-gpio-ctrl1",
870 }, {
871 /* pin-controller instance 2 data */
872 .pin_banks = exynos4210_pin_banks2,
873 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
43b169db
TA
874 .label = "exynos4210-gpio-ctrl2",
875 },
876};
6edc794a
TF
877
878/* pin banks of exynos4x12 pin-controller 0 */
879static struct samsung_pin_bank exynos4x12_pin_banks0[] = {
880 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
881 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
882 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
883 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
884 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
885 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
886 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
887 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
888 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
889 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
890 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
891 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
892 EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
893};
894
895/* pin banks of exynos4x12 pin-controller 1 */
896static struct samsung_pin_bank exynos4x12_pin_banks1[] = {
897 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
898 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
899 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
900 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
901 EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
902 EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
903 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
904 EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
905 EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
906 EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
907 EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
908 EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
909 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
910 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
911 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
912 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
913 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
914 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
915 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
916 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
917 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
918 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
919 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
920};
921
922/* pin banks of exynos4x12 pin-controller 2 */
923static struct samsung_pin_bank exynos4x12_pin_banks2[] = {
924 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
925};
926
927/* pin banks of exynos4x12 pin-controller 3 */
928static struct samsung_pin_bank exynos4x12_pin_banks3[] = {
929 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
930 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
931 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
932 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
933 EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
934};
935
936/*
937 * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
938 * four gpio/pin-mux/pinconfig controllers.
939 */
940struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = {
941 {
942 /* pin-controller instance 0 data */
943 .pin_banks = exynos4x12_pin_banks0,
944 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks0),
945 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
946 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
947 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
948 .svc = EXYNOS_SVC_OFFSET,
949 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
950 .suspend = exynos_pinctrl_suspend,
951 .resume = exynos_pinctrl_resume,
6edc794a
TF
952 .label = "exynos4x12-gpio-ctrl0",
953 }, {
954 /* pin-controller instance 1 data */
955 .pin_banks = exynos4x12_pin_banks1,
956 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks1),
957 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
958 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
959 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
960 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
961 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
962 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
963 .svc = EXYNOS_SVC_OFFSET,
964 .eint_gpio_init = exynos_eint_gpio_init,
965 .eint_wkup_init = exynos_eint_wkup_init,
7ccbc60c
TF
966 .suspend = exynos_pinctrl_suspend,
967 .resume = exynos_pinctrl_resume,
6edc794a
TF
968 .label = "exynos4x12-gpio-ctrl1",
969 }, {
970 /* pin-controller instance 2 data */
971 .pin_banks = exynos4x12_pin_banks2,
972 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks2),
973 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
974 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
975 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
976 .svc = EXYNOS_SVC_OFFSET,
977 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
978 .suspend = exynos_pinctrl_suspend,
979 .resume = exynos_pinctrl_resume,
6edc794a
TF
980 .label = "exynos4x12-gpio-ctrl2",
981 }, {
982 /* pin-controller instance 3 data */
983 .pin_banks = exynos4x12_pin_banks3,
984 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks3),
985 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
986 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
987 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
988 .svc = EXYNOS_SVC_OFFSET,
989 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
990 .suspend = exynos_pinctrl_suspend,
991 .resume = exynos_pinctrl_resume,
6edc794a
TF
992 .label = "exynos4x12-gpio-ctrl3",
993 },
994};
f67faf48
TA
995
996/* pin banks of exynos5250 pin-controller 0 */
997static struct samsung_pin_bank exynos5250_pin_banks0[] = {
998 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
999 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
1000 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
1001 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
1002 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
1003 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
1004 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
1005 EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
1006 EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc1", 0x20),
1007 EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc2", 0x24),
1008 EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc3", 0x28),
1009 EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpd0", 0x2c),
1010 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x30),
1011 EXYNOS_PIN_BANK_EINTG(7, 0x2E0, "gpc4", 0x34),
1012 EXYNOS_PIN_BANK_EINTN(6, 0x1A0, "gpy0"),
1013 EXYNOS_PIN_BANK_EINTN(4, 0x1C0, "gpy1"),
1014 EXYNOS_PIN_BANK_EINTN(6, 0x1E0, "gpy2"),
1015 EXYNOS_PIN_BANK_EINTN(8, 0x200, "gpy3"),
1016 EXYNOS_PIN_BANK_EINTN(8, 0x220, "gpy4"),
1017 EXYNOS_PIN_BANK_EINTN(8, 0x240, "gpy5"),
1018 EXYNOS_PIN_BANK_EINTN(8, 0x260, "gpy6"),
1019 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
1020 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
1021 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
1022 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
1023};
1024
1025/* pin banks of exynos5250 pin-controller 1 */
1026static struct samsung_pin_bank exynos5250_pin_banks1[] = {
1027 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
1028 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
1029 EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08),
1030 EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf1", 0x0c),
1031 EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
1032 EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
1033 EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
1034 EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gph0", 0x1c),
1035 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph1", 0x20),
1036};
1037
1038/* pin banks of exynos5250 pin-controller 2 */
1039static struct samsung_pin_bank exynos5250_pin_banks2[] = {
1040 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
1041 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
1042 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
1043 EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
1044 EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
1045};
1046
1047/* pin banks of exynos5250 pin-controller 3 */
1048static struct samsung_pin_bank exynos5250_pin_banks3[] = {
1049 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
1050};
1051
1052/*
1053 * Samsung pinctrl driver data for Exynos5250 SoC. Exynos5250 SoC includes
1054 * four gpio/pin-mux/pinconfig controllers.
1055 */
1056struct samsung_pin_ctrl exynos5250_pin_ctrl[] = {
1057 {
1058 /* pin-controller instance 0 data */
1059 .pin_banks = exynos5250_pin_banks0,
1060 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks0),
1061 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1062 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1063 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1064 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
1065 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
1066 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
1067 .svc = EXYNOS_SVC_OFFSET,
1068 .eint_gpio_init = exynos_eint_gpio_init,
1069 .eint_wkup_init = exynos_eint_wkup_init,
7ccbc60c
TF
1070 .suspend = exynos_pinctrl_suspend,
1071 .resume = exynos_pinctrl_resume,
f67faf48
TA
1072 .label = "exynos5250-gpio-ctrl0",
1073 }, {
1074 /* pin-controller instance 1 data */
1075 .pin_banks = exynos5250_pin_banks1,
1076 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks1),
1077 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1078 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1079 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1080 .svc = EXYNOS_SVC_OFFSET,
1081 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
1082 .suspend = exynos_pinctrl_suspend,
1083 .resume = exynos_pinctrl_resume,
f67faf48
TA
1084 .label = "exynos5250-gpio-ctrl1",
1085 }, {
1086 /* pin-controller instance 2 data */
1087 .pin_banks = exynos5250_pin_banks2,
1088 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks2),
1089 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1090 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1091 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1092 .svc = EXYNOS_SVC_OFFSET,
1093 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
1094 .suspend = exynos_pinctrl_suspend,
1095 .resume = exynos_pinctrl_resume,
f67faf48
TA
1096 .label = "exynos5250-gpio-ctrl2",
1097 }, {
1098 /* pin-controller instance 3 data */
1099 .pin_banks = exynos5250_pin_banks3,
1100 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks3),
1101 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1102 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1103 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1104 .svc = EXYNOS_SVC_OFFSET,
1105 .eint_gpio_init = exynos_eint_gpio_init,
7ccbc60c
TF
1106 .suspend = exynos_pinctrl_suspend,
1107 .resume = exynos_pinctrl_resume,
f67faf48
TA
1108 .label = "exynos5250-gpio-ctrl3",
1109 },
1110};
983dbeb3 1111
9a8b6079
YGJ
1112/* pin banks of exynos5260 pin-controller 0 */
1113static struct samsung_pin_bank exynos5260_pin_banks0[] = {
1114 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpa0", 0x00),
1115 EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpa1", 0x04),
1116 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
1117 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
1118 EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpb1", 0x10),
1119 EXYNOS_PIN_BANK_EINTG(5, 0x0a0, "gpb2", 0x14),
1120 EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpb3", 0x18),
1121 EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpb4", 0x1c),
1122 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpb5", 0x20),
1123 EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpd0", 0x24),
1124 EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpd1", 0x28),
1125 EXYNOS_PIN_BANK_EINTG(5, 0x160, "gpd2", 0x2c),
1126 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpe0", 0x30),
1127 EXYNOS_PIN_BANK_EINTG(5, 0x1a0, "gpe1", 0x34),
1128 EXYNOS_PIN_BANK_EINTG(4, 0x1c0, "gpf0", 0x38),
1129 EXYNOS_PIN_BANK_EINTG(8, 0x1e0, "gpf1", 0x3c),
1130 EXYNOS_PIN_BANK_EINTG(2, 0x200, "gpk0", 0x40),
1131 EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00),
1132 EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04),
1133 EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08),
1134 EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
1135};
1136
1137/* pin banks of exynos5260 pin-controller 1 */
1138static struct samsung_pin_bank exynos5260_pin_banks1[] = {
1139 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpc0", 0x00),
1140 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpc1", 0x04),
1141 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
1142 EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
1143 EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpc4", 0x10),
1144};
1145
1146/* pin banks of exynos5260 pin-controller 2 */
1147static struct samsung_pin_bank exynos5260_pin_banks2[] = {
1148 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
1149 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
1150};
1151
1152/*
1153 * Samsung pinctrl driver data for Exynos5260 SoC. Exynos5260 SoC includes
1154 * three gpio/pin-mux/pinconfig controllers.
1155 */
1156struct samsung_pin_ctrl exynos5260_pin_ctrl[] = {
1157 {
1158 /* pin-controller instance 0 data */
1159 .pin_banks = exynos5260_pin_banks0,
1160 .nr_banks = ARRAY_SIZE(exynos5260_pin_banks0),
1161 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1162 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1163 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1164 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
1165 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
1166 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
1167 .svc = EXYNOS_SVC_OFFSET,
1168 .eint_gpio_init = exynos_eint_gpio_init,
1169 .eint_wkup_init = exynos_eint_wkup_init,
1170 .label = "exynos5260-gpio-ctrl0",
1171 }, {
1172 /* pin-controller instance 1 data */
1173 .pin_banks = exynos5260_pin_banks1,
1174 .nr_banks = ARRAY_SIZE(exynos5260_pin_banks1),
1175 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1176 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1177 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1178 .svc = EXYNOS_SVC_OFFSET,
1179 .eint_gpio_init = exynos_eint_gpio_init,
1180 .label = "exynos5260-gpio-ctrl1",
1181 }, {
1182 /* pin-controller instance 2 data */
1183 .pin_banks = exynos5260_pin_banks2,
1184 .nr_banks = ARRAY_SIZE(exynos5260_pin_banks2),
1185 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1186 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1187 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1188 .svc = EXYNOS_SVC_OFFSET,
1189 .eint_gpio_init = exynos_eint_gpio_init,
1190 .label = "exynos5260-gpio-ctrl2",
1191 },
1192};
1193
983dbeb3
LKA
1194/* pin banks of exynos5420 pin-controller 0 */
1195static struct samsung_pin_bank exynos5420_pin_banks0[] = {
1196 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00),
1197 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
1198 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
1199 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
1200 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
1201};
1202
1203/* pin banks of exynos5420 pin-controller 1 */
1204static struct samsung_pin_bank exynos5420_pin_banks1[] = {
1205 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpc0", 0x00),
1206 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc1", 0x04),
1207 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
1208 EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
1209 EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpc4", 0x10),
1210 EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpd1", 0x14),
1211 EXYNOS_PIN_BANK_EINTN(6, 0x0C0, "gpy0"),
1212 EXYNOS_PIN_BANK_EINTN(4, 0x0E0, "gpy1"),
1213 EXYNOS_PIN_BANK_EINTN(6, 0x100, "gpy2"),
1214 EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpy3"),
1215 EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpy4"),
1216 EXYNOS_PIN_BANK_EINTN(8, 0x160, "gpy5"),
1217 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy6"),
1218};
1219
1220/* pin banks of exynos5420 pin-controller 2 */
1221static struct samsung_pin_bank exynos5420_pin_banks2[] = {
1222 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
1223 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
1224 EXYNOS_PIN_BANK_EINTG(6, 0x040, "gpf0", 0x08),
1225 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpf1", 0x0c),
1226 EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
1227 EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
1228 EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
1229 EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gpj4", 0x1c),
1230};
1231
1232/* pin banks of exynos5420 pin-controller 3 */
1233static struct samsung_pin_bank exynos5420_pin_banks3[] = {
1234 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
1235 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
1236 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
1237 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
1238 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
1239 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
1240 EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpb3", 0x18),
1241 EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpb4", 0x1c),
1242 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph0", 0x20),
1243};
1244
1245/* pin banks of exynos5420 pin-controller 4 */
1246static struct samsung_pin_bank exynos5420_pin_banks4[] = {
1247 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
1248};
1249
1250/*
1251 * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes
1252 * four gpio/pin-mux/pinconfig controllers.
1253 */
1254struct samsung_pin_ctrl exynos5420_pin_ctrl[] = {
1255 {
1256 /* pin-controller instance 0 data */
1257 .pin_banks = exynos5420_pin_banks0,
1258 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks0),
1259 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1260 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1261 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1262 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
1263 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
1264 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
1265 .svc = EXYNOS_SVC_OFFSET,
1266 .eint_gpio_init = exynos_eint_gpio_init,
1267 .eint_wkup_init = exynos_eint_wkup_init,
1268 .label = "exynos5420-gpio-ctrl0",
1269 }, {
1270 /* pin-controller instance 1 data */
1271 .pin_banks = exynos5420_pin_banks1,
1272 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks1),
1273 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1274 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1275 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1276 .svc = EXYNOS_SVC_OFFSET,
1277 .eint_gpio_init = exynos_eint_gpio_init,
1278 .label = "exynos5420-gpio-ctrl1",
1279 }, {
1280 /* pin-controller instance 2 data */
1281 .pin_banks = exynos5420_pin_banks2,
1282 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks2),
1283 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1284 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1285 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1286 .svc = EXYNOS_SVC_OFFSET,
1287 .eint_gpio_init = exynos_eint_gpio_init,
1288 .label = "exynos5420-gpio-ctrl2",
1289 }, {
1290 /* pin-controller instance 3 data */
1291 .pin_banks = exynos5420_pin_banks3,
1292 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks3),
1293 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1294 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1295 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1296 .svc = EXYNOS_SVC_OFFSET,
1297 .eint_gpio_init = exynos_eint_gpio_init,
1298 .label = "exynos5420-gpio-ctrl3",
1299 }, {
1300 /* pin-controller instance 4 data */
1301 .pin_banks = exynos5420_pin_banks4,
1302 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks4),
1303 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
1304 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
1305 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
1306 .svc = EXYNOS_SVC_OFFSET,
1307 .eint_gpio_init = exynos_eint_gpio_init,
1308 .label = "exynos5420-gpio-ctrl4",
1309 },
1310};