2 * Exynos specific support for Samsung pinctrl/gpiolib driver with eint support.
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * Copyright (c) 2012 Linaro Ltd
7 * http://www.linaro.org
9 * Author: Thomas Abraham <thomas.ab@samsung.com>
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.
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.
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>
26 #include <linux/of_irq.h>
28 #include <linux/slab.h>
29 #include <linux/spinlock.h>
30 #include <linux/err.h>
32 #include <asm/mach/irq.h>
34 #include "pinctrl-samsung.h"
35 #include "pinctrl-exynos.h"
38 static struct samsung_pin_bank_type bank_type_off = {
39 .fld_width = { 4, 1, 2, 2, 2, 2, },
40 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
43 static struct samsung_pin_bank_type bank_type_alive = {
44 .fld_width = { 4, 1, 2, 2, },
45 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
48 /* list of external wakeup controllers supported */
49 static const struct of_device_id exynos_wkup_irq_ids[] = {
50 { .compatible = "samsung,exynos4210-wakeup-eint", },
54 static void exynos_gpio_irq_unmask(struct irq_data *irqd)
56 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
57 struct samsung_pinctrl_drv_data *d = bank->drvdata;
58 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
61 mask = readl(d->virt_base + reg_mask);
62 mask &= ~(1 << irqd->hwirq);
63 writel(mask, d->virt_base + reg_mask);
66 static void exynos_gpio_irq_mask(struct irq_data *irqd)
68 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
69 struct samsung_pinctrl_drv_data *d = bank->drvdata;
70 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
73 mask = readl(d->virt_base + reg_mask);
74 mask |= 1 << irqd->hwirq;
75 writel(mask, d->virt_base + reg_mask);
78 static void exynos_gpio_irq_ack(struct irq_data *irqd)
80 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
81 struct samsung_pinctrl_drv_data *d = bank->drvdata;
82 unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
84 writel(1 << irqd->hwirq, d->virt_base + reg_pend);
87 static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
89 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
90 struct samsung_pin_bank_type *bank_type = bank->type;
91 struct samsung_pinctrl_drv_data *d = bank->drvdata;
92 struct samsung_pin_ctrl *ctrl = d->ctrl;
93 unsigned int pin = irqd->hwirq;
94 unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
95 unsigned int con, trig_type;
96 unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
101 case IRQ_TYPE_EDGE_RISING:
102 trig_type = EXYNOS_EINT_EDGE_RISING;
104 case IRQ_TYPE_EDGE_FALLING:
105 trig_type = EXYNOS_EINT_EDGE_FALLING;
107 case IRQ_TYPE_EDGE_BOTH:
108 trig_type = EXYNOS_EINT_EDGE_BOTH;
110 case IRQ_TYPE_LEVEL_HIGH:
111 trig_type = EXYNOS_EINT_LEVEL_HIGH;
113 case IRQ_TYPE_LEVEL_LOW:
114 trig_type = EXYNOS_EINT_LEVEL_LOW;
117 pr_err("unsupported external interrupt type\n");
121 if (type & IRQ_TYPE_EDGE_BOTH)
122 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
124 __irq_set_handler_locked(irqd->irq, handle_level_irq);
126 con = readl(d->virt_base + reg_con);
127 con &= ~(EXYNOS_EINT_CON_MASK << shift);
128 con |= trig_type << shift;
129 writel(con, d->virt_base + reg_con);
131 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
132 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
133 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
135 spin_lock_irqsave(&bank->slock, flags);
137 con = readl(d->virt_base + reg_con);
138 con &= ~(mask << shift);
139 con |= EXYNOS_EINT_FUNC << shift;
140 writel(con, d->virt_base + reg_con);
142 spin_unlock_irqrestore(&bank->slock, flags);
148 * irq_chip for gpio interrupts.
150 static struct irq_chip exynos_gpio_irq_chip = {
151 .name = "exynos_gpio_irq_chip",
152 .irq_unmask = exynos_gpio_irq_unmask,
153 .irq_mask = exynos_gpio_irq_mask,
154 .irq_ack = exynos_gpio_irq_ack,
155 .irq_set_type = exynos_gpio_irq_set_type,
158 static int exynos_gpio_irq_map(struct irq_domain *h, unsigned int virq,
161 struct samsung_pin_bank *b = h->host_data;
163 irq_set_chip_data(virq, b);
164 irq_set_chip_and_handler(virq, &exynos_gpio_irq_chip,
166 set_irq_flags(virq, IRQF_VALID);
171 * irq domain callbacks for external gpio interrupt controller.
173 static const struct irq_domain_ops exynos_gpio_irqd_ops = {
174 .map = exynos_gpio_irq_map,
175 .xlate = irq_domain_xlate_twocell,
178 static irqreturn_t exynos_eint_gpio_irq(int irq, void *data)
180 struct samsung_pinctrl_drv_data *d = data;
181 struct samsung_pin_ctrl *ctrl = d->ctrl;
182 struct samsung_pin_bank *bank = ctrl->pin_banks;
183 unsigned int svc, group, pin, virq;
185 svc = readl(d->virt_base + ctrl->svc);
186 group = EXYNOS_SVC_GROUP(svc);
187 pin = svc & EXYNOS_SVC_NUM_MASK;
193 virq = irq_linear_revmap(bank->irq_domain, pin);
196 generic_handle_irq(virq);
201 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
202 * @d: driver data of samsung pinctrl driver.
204 static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
206 struct samsung_pin_bank *bank;
207 struct device *dev = d->dev;
212 dev_err(dev, "irq number not available\n");
216 ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
217 0, dev_name(dev), d);
219 dev_err(dev, "irq request failed\n");
223 bank = d->ctrl->pin_banks;
224 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
225 if (bank->eint_type != EINT_TYPE_GPIO)
227 bank->irq_domain = irq_domain_add_linear(bank->of_node,
228 bank->nr_pins, &exynos_gpio_irqd_ops, bank);
229 if (!bank->irq_domain) {
230 dev_err(dev, "gpio irq domain add failed\n");
238 static void exynos_wkup_irq_unmask(struct irq_data *irqd)
240 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
241 struct samsung_pinctrl_drv_data *d = b->drvdata;
242 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
245 mask = readl(d->virt_base + reg_mask);
246 mask &= ~(1 << irqd->hwirq);
247 writel(mask, d->virt_base + reg_mask);
250 static void exynos_wkup_irq_mask(struct irq_data *irqd)
252 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
253 struct samsung_pinctrl_drv_data *d = b->drvdata;
254 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
257 mask = readl(d->virt_base + reg_mask);
258 mask |= 1 << irqd->hwirq;
259 writel(mask, d->virt_base + reg_mask);
262 static void exynos_wkup_irq_ack(struct irq_data *irqd)
264 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
265 struct samsung_pinctrl_drv_data *d = b->drvdata;
266 unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
268 writel(1 << irqd->hwirq, d->virt_base + pend);
271 static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
273 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
274 struct samsung_pin_bank_type *bank_type = bank->type;
275 struct samsung_pinctrl_drv_data *d = bank->drvdata;
276 unsigned int pin = irqd->hwirq;
277 unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
278 unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
279 unsigned long con, trig_type;
284 case IRQ_TYPE_EDGE_RISING:
285 trig_type = EXYNOS_EINT_EDGE_RISING;
287 case IRQ_TYPE_EDGE_FALLING:
288 trig_type = EXYNOS_EINT_EDGE_FALLING;
290 case IRQ_TYPE_EDGE_BOTH:
291 trig_type = EXYNOS_EINT_EDGE_BOTH;
293 case IRQ_TYPE_LEVEL_HIGH:
294 trig_type = EXYNOS_EINT_LEVEL_HIGH;
296 case IRQ_TYPE_LEVEL_LOW:
297 trig_type = EXYNOS_EINT_LEVEL_LOW;
300 pr_err("unsupported external interrupt type\n");
304 if (type & IRQ_TYPE_EDGE_BOTH)
305 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
307 __irq_set_handler_locked(irqd->irq, handle_level_irq);
309 con = readl(d->virt_base + reg_con);
310 con &= ~(EXYNOS_EINT_CON_MASK << shift);
311 con |= trig_type << shift;
312 writel(con, d->virt_base + reg_con);
314 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
315 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
316 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
318 spin_lock_irqsave(&bank->slock, flags);
320 con = readl(d->virt_base + reg_con);
321 con &= ~(mask << shift);
322 con |= EXYNOS_EINT_FUNC << shift;
323 writel(con, d->virt_base + reg_con);
325 spin_unlock_irqrestore(&bank->slock, flags);
331 * irq_chip for wakeup interrupts
333 static struct irq_chip exynos_wkup_irq_chip = {
334 .name = "exynos_wkup_irq_chip",
335 .irq_unmask = exynos_wkup_irq_unmask,
336 .irq_mask = exynos_wkup_irq_mask,
337 .irq_ack = exynos_wkup_irq_ack,
338 .irq_set_type = exynos_wkup_irq_set_type,
341 /* interrupt handler for wakeup interrupts 0..15 */
342 static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
344 struct exynos_weint_data *eintd = irq_get_handler_data(irq);
345 struct samsung_pin_bank *bank = eintd->bank;
346 struct irq_chip *chip = irq_get_chip(irq);
349 chained_irq_enter(chip, desc);
350 chip->irq_mask(&desc->irq_data);
353 chip->irq_ack(&desc->irq_data);
355 eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
356 generic_handle_irq(eint_irq);
357 chip->irq_unmask(&desc->irq_data);
358 chained_irq_exit(chip, desc);
361 static inline void exynos_irq_demux_eint(unsigned long pend,
362 struct irq_domain *domain)
368 generic_handle_irq(irq_find_mapping(domain, irq));
373 /* interrupt handler for wakeup interrupt 16 */
374 static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
376 struct irq_chip *chip = irq_get_chip(irq);
377 struct exynos_muxed_weint_data *eintd = irq_get_handler_data(irq);
378 struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata;
379 struct samsung_pin_ctrl *ctrl = d->ctrl;
384 chained_irq_enter(chip, desc);
386 for (i = 0; i < eintd->nr_banks; ++i) {
387 struct samsung_pin_bank *b = eintd->banks[i];
388 pend = readl(d->virt_base + ctrl->weint_pend + b->eint_offset);
389 mask = readl(d->virt_base + ctrl->weint_mask + b->eint_offset);
390 exynos_irq_demux_eint(pend & ~mask, b->irq_domain);
393 chained_irq_exit(chip, desc);
396 static int exynos_wkup_irq_map(struct irq_domain *h, unsigned int virq,
399 irq_set_chip_and_handler(virq, &exynos_wkup_irq_chip, handle_level_irq);
400 irq_set_chip_data(virq, h->host_data);
401 set_irq_flags(virq, IRQF_VALID);
406 * irq domain callbacks for external wakeup interrupt controller.
408 static const struct irq_domain_ops exynos_wkup_irqd_ops = {
409 .map = exynos_wkup_irq_map,
410 .xlate = irq_domain_xlate_twocell,
414 * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
415 * @d: driver data of samsung pinctrl driver.
417 static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
419 struct device *dev = d->dev;
420 struct device_node *wkup_np = NULL;
421 struct device_node *np;
422 struct samsung_pin_bank *bank;
423 struct exynos_weint_data *weint_data;
424 struct exynos_muxed_weint_data *muxed_data;
425 unsigned int muxed_banks = 0;
429 for_each_child_of_node(dev->of_node, np) {
430 if (of_match_node(exynos_wkup_irq_ids, np)) {
438 bank = d->ctrl->pin_banks;
439 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
440 if (bank->eint_type != EINT_TYPE_WKUP)
443 bank->irq_domain = irq_domain_add_linear(bank->of_node,
444 bank->nr_pins, &exynos_wkup_irqd_ops, bank);
445 if (!bank->irq_domain) {
446 dev_err(dev, "wkup irq domain add failed\n");
450 if (!of_find_property(bank->of_node, "interrupts", NULL)) {
451 bank->eint_type = EINT_TYPE_WKUP_MUX;
456 weint_data = devm_kzalloc(dev, bank->nr_pins
457 * sizeof(*weint_data), GFP_KERNEL);
459 dev_err(dev, "could not allocate memory for weint_data\n");
463 for (idx = 0; idx < bank->nr_pins; ++idx) {
464 irq = irq_of_parse_and_map(bank->of_node, idx);
466 dev_err(dev, "irq number for eint-%s-%d not found\n",
470 weint_data[idx].irq = idx;
471 weint_data[idx].bank = bank;
472 irq_set_handler_data(irq, &weint_data[idx]);
473 irq_set_chained_handler(irq, exynos_irq_eint0_15);
480 irq = irq_of_parse_and_map(wkup_np, 0);
482 dev_err(dev, "irq number for muxed EINTs not found\n");
486 muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
487 + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
489 dev_err(dev, "could not allocate memory for muxed_data\n");
493 irq_set_chained_handler(irq, exynos_irq_demux_eint16_31);
494 irq_set_handler_data(irq, muxed_data);
496 bank = d->ctrl->pin_banks;
498 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
499 if (bank->eint_type != EINT_TYPE_WKUP_MUX)
502 muxed_data->banks[idx++] = bank;
504 muxed_data->nr_banks = muxed_banks;
509 /* pin banks of exynos4210 pin-controller 0 */
510 static struct samsung_pin_bank exynos4210_pin_banks0[] = {
511 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
512 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
513 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
514 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
515 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
516 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
517 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
518 EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
519 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
520 EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
521 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
522 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
523 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
524 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
525 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
526 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
529 /* pin banks of exynos4210 pin-controller 1 */
530 static struct samsung_pin_bank exynos4210_pin_banks1[] = {
531 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
532 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
533 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
534 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
535 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
536 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
537 EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
538 EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
539 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
540 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
541 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
542 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
543 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
544 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
545 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
546 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
547 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
548 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
549 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
550 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
553 /* pin banks of exynos4210 pin-controller 2 */
554 static struct samsung_pin_bank exynos4210_pin_banks2[] = {
555 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
559 * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
560 * three gpio/pin-mux/pinconfig controllers.
562 struct samsung_pin_ctrl exynos4210_pin_ctrl[] = {
564 /* pin-controller instance 0 data */
565 .pin_banks = exynos4210_pin_banks0,
566 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
567 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
568 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
569 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
570 .svc = EXYNOS_SVC_OFFSET,
571 .eint_gpio_init = exynos_eint_gpio_init,
572 .label = "exynos4210-gpio-ctrl0",
574 /* pin-controller instance 1 data */
575 .pin_banks = exynos4210_pin_banks1,
576 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
577 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
578 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
579 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
580 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
581 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
582 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
583 .svc = EXYNOS_SVC_OFFSET,
584 .eint_gpio_init = exynos_eint_gpio_init,
585 .eint_wkup_init = exynos_eint_wkup_init,
586 .label = "exynos4210-gpio-ctrl1",
588 /* pin-controller instance 2 data */
589 .pin_banks = exynos4210_pin_banks2,
590 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
591 .label = "exynos4210-gpio-ctrl2",
595 /* pin banks of exynos4x12 pin-controller 0 */
596 static struct samsung_pin_bank exynos4x12_pin_banks0[] = {
597 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
598 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
599 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
600 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
601 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
602 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
603 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
604 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
605 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
606 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
607 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
608 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
609 EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
612 /* pin banks of exynos4x12 pin-controller 1 */
613 static struct samsung_pin_bank exynos4x12_pin_banks1[] = {
614 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
615 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
616 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
617 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
618 EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
619 EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
620 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
621 EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
622 EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
623 EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
624 EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
625 EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
626 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
627 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
628 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
629 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
630 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
631 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
632 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
633 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
634 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
635 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
636 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
639 /* pin banks of exynos4x12 pin-controller 2 */
640 static struct samsung_pin_bank exynos4x12_pin_banks2[] = {
641 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
644 /* pin banks of exynos4x12 pin-controller 3 */
645 static struct samsung_pin_bank exynos4x12_pin_banks3[] = {
646 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
647 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
648 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
649 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
650 EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
654 * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
655 * four gpio/pin-mux/pinconfig controllers.
657 struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = {
659 /* pin-controller instance 0 data */
660 .pin_banks = exynos4x12_pin_banks0,
661 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks0),
662 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
663 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
664 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
665 .svc = EXYNOS_SVC_OFFSET,
666 .eint_gpio_init = exynos_eint_gpio_init,
667 .label = "exynos4x12-gpio-ctrl0",
669 /* pin-controller instance 1 data */
670 .pin_banks = exynos4x12_pin_banks1,
671 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks1),
672 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
673 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
674 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
675 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
676 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
677 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
678 .svc = EXYNOS_SVC_OFFSET,
679 .eint_gpio_init = exynos_eint_gpio_init,
680 .eint_wkup_init = exynos_eint_wkup_init,
681 .label = "exynos4x12-gpio-ctrl1",
683 /* pin-controller instance 2 data */
684 .pin_banks = exynos4x12_pin_banks2,
685 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks2),
686 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
687 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
688 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
689 .svc = EXYNOS_SVC_OFFSET,
690 .eint_gpio_init = exynos_eint_gpio_init,
691 .label = "exynos4x12-gpio-ctrl2",
693 /* pin-controller instance 3 data */
694 .pin_banks = exynos4x12_pin_banks3,
695 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks3),
696 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
697 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
698 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
699 .svc = EXYNOS_SVC_OFFSET,
700 .eint_gpio_init = exynos_eint_gpio_init,
701 .label = "exynos4x12-gpio-ctrl3",