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, },
42 static struct samsung_pin_bank_type bank_type_alive = {
43 .fld_width = { 4, 1, 2, 2, },
46 /* list of external wakeup controllers supported */
47 static const struct of_device_id exynos_wkup_irq_ids[] = {
48 { .compatible = "samsung,exynos4210-wakeup-eint", },
52 static void exynos_gpio_irq_unmask(struct irq_data *irqd)
54 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
55 struct samsung_pinctrl_drv_data *d = bank->drvdata;
56 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
59 mask = readl(d->virt_base + reg_mask);
60 mask &= ~(1 << irqd->hwirq);
61 writel(mask, d->virt_base + reg_mask);
64 static void exynos_gpio_irq_mask(struct irq_data *irqd)
66 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
67 struct samsung_pinctrl_drv_data *d = bank->drvdata;
68 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
71 mask = readl(d->virt_base + reg_mask);
72 mask |= 1 << irqd->hwirq;
73 writel(mask, d->virt_base + reg_mask);
76 static void exynos_gpio_irq_ack(struct irq_data *irqd)
78 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
79 struct samsung_pinctrl_drv_data *d = bank->drvdata;
80 unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
82 writel(1 << irqd->hwirq, d->virt_base + reg_pend);
85 static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
87 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
88 struct samsung_pin_bank_type *bank_type = bank->type;
89 struct samsung_pinctrl_drv_data *d = bank->drvdata;
90 struct samsung_pin_ctrl *ctrl = d->ctrl;
91 unsigned int pin = irqd->hwirq;
92 unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
93 unsigned int con, trig_type;
94 unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
99 case IRQ_TYPE_EDGE_RISING:
100 trig_type = EXYNOS_EINT_EDGE_RISING;
102 case IRQ_TYPE_EDGE_FALLING:
103 trig_type = EXYNOS_EINT_EDGE_FALLING;
105 case IRQ_TYPE_EDGE_BOTH:
106 trig_type = EXYNOS_EINT_EDGE_BOTH;
108 case IRQ_TYPE_LEVEL_HIGH:
109 trig_type = EXYNOS_EINT_LEVEL_HIGH;
111 case IRQ_TYPE_LEVEL_LOW:
112 trig_type = EXYNOS_EINT_LEVEL_LOW;
115 pr_err("unsupported external interrupt type\n");
119 if (type & IRQ_TYPE_EDGE_BOTH)
120 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
122 __irq_set_handler_locked(irqd->irq, handle_level_irq);
124 con = readl(d->virt_base + reg_con);
125 con &= ~(EXYNOS_EINT_CON_MASK << shift);
126 con |= trig_type << shift;
127 writel(con, d->virt_base + reg_con);
129 reg_con = bank->pctl_offset;
130 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
131 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
133 spin_lock_irqsave(&bank->slock, flags);
135 con = readl(d->virt_base + reg_con);
136 con &= ~(mask << shift);
137 con |= EXYNOS_EINT_FUNC << shift;
138 writel(con, d->virt_base + reg_con);
140 spin_unlock_irqrestore(&bank->slock, flags);
146 * irq_chip for gpio interrupts.
148 static struct irq_chip exynos_gpio_irq_chip = {
149 .name = "exynos_gpio_irq_chip",
150 .irq_unmask = exynos_gpio_irq_unmask,
151 .irq_mask = exynos_gpio_irq_mask,
152 .irq_ack = exynos_gpio_irq_ack,
153 .irq_set_type = exynos_gpio_irq_set_type,
156 static int exynos_gpio_irq_map(struct irq_domain *h, unsigned int virq,
159 struct samsung_pin_bank *b = h->host_data;
161 irq_set_chip_data(virq, b);
162 irq_set_chip_and_handler(virq, &exynos_gpio_irq_chip,
164 set_irq_flags(virq, IRQF_VALID);
169 * irq domain callbacks for external gpio interrupt controller.
171 static const struct irq_domain_ops exynos_gpio_irqd_ops = {
172 .map = exynos_gpio_irq_map,
173 .xlate = irq_domain_xlate_twocell,
176 static irqreturn_t exynos_eint_gpio_irq(int irq, void *data)
178 struct samsung_pinctrl_drv_data *d = data;
179 struct samsung_pin_ctrl *ctrl = d->ctrl;
180 struct samsung_pin_bank *bank = ctrl->pin_banks;
181 unsigned int svc, group, pin, virq;
183 svc = readl(d->virt_base + ctrl->svc);
184 group = EXYNOS_SVC_GROUP(svc);
185 pin = svc & EXYNOS_SVC_NUM_MASK;
191 virq = irq_linear_revmap(bank->irq_domain, pin);
194 generic_handle_irq(virq);
199 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
200 * @d: driver data of samsung pinctrl driver.
202 static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
204 struct samsung_pin_bank *bank;
205 struct device *dev = d->dev;
210 dev_err(dev, "irq number not available\n");
214 ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
215 0, dev_name(dev), d);
217 dev_err(dev, "irq request failed\n");
221 bank = d->ctrl->pin_banks;
222 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
223 if (bank->eint_type != EINT_TYPE_GPIO)
225 bank->irq_domain = irq_domain_add_linear(bank->of_node,
226 bank->nr_pins, &exynos_gpio_irqd_ops, bank);
227 if (!bank->irq_domain) {
228 dev_err(dev, "gpio irq domain add failed\n");
236 static void exynos_wkup_irq_unmask(struct irq_data *irqd)
238 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
239 struct samsung_pinctrl_drv_data *d = b->drvdata;
240 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
243 mask = readl(d->virt_base + reg_mask);
244 mask &= ~(1 << irqd->hwirq);
245 writel(mask, d->virt_base + reg_mask);
248 static void exynos_wkup_irq_mask(struct irq_data *irqd)
250 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
251 struct samsung_pinctrl_drv_data *d = b->drvdata;
252 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
255 mask = readl(d->virt_base + reg_mask);
256 mask |= 1 << irqd->hwirq;
257 writel(mask, d->virt_base + reg_mask);
260 static void exynos_wkup_irq_ack(struct irq_data *irqd)
262 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
263 struct samsung_pinctrl_drv_data *d = b->drvdata;
264 unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
266 writel(1 << irqd->hwirq, d->virt_base + pend);
269 static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
271 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
272 struct samsung_pin_bank_type *bank_type = bank->type;
273 struct samsung_pinctrl_drv_data *d = bank->drvdata;
274 unsigned int pin = irqd->hwirq;
275 unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
276 unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
277 unsigned long con, trig_type;
282 case IRQ_TYPE_EDGE_RISING:
283 trig_type = EXYNOS_EINT_EDGE_RISING;
285 case IRQ_TYPE_EDGE_FALLING:
286 trig_type = EXYNOS_EINT_EDGE_FALLING;
288 case IRQ_TYPE_EDGE_BOTH:
289 trig_type = EXYNOS_EINT_EDGE_BOTH;
291 case IRQ_TYPE_LEVEL_HIGH:
292 trig_type = EXYNOS_EINT_LEVEL_HIGH;
294 case IRQ_TYPE_LEVEL_LOW:
295 trig_type = EXYNOS_EINT_LEVEL_LOW;
298 pr_err("unsupported external interrupt type\n");
302 if (type & IRQ_TYPE_EDGE_BOTH)
303 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
305 __irq_set_handler_locked(irqd->irq, handle_level_irq);
307 con = readl(d->virt_base + reg_con);
308 con &= ~(EXYNOS_EINT_CON_MASK << shift);
309 con |= trig_type << shift;
310 writel(con, d->virt_base + reg_con);
312 reg_con = bank->pctl_offset;
313 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
314 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
316 spin_lock_irqsave(&bank->slock, flags);
318 con = readl(d->virt_base + reg_con);
319 con &= ~(mask << shift);
320 con |= EXYNOS_EINT_FUNC << shift;
321 writel(con, d->virt_base + reg_con);
323 spin_unlock_irqrestore(&bank->slock, flags);
329 * irq_chip for wakeup interrupts
331 static struct irq_chip exynos_wkup_irq_chip = {
332 .name = "exynos_wkup_irq_chip",
333 .irq_unmask = exynos_wkup_irq_unmask,
334 .irq_mask = exynos_wkup_irq_mask,
335 .irq_ack = exynos_wkup_irq_ack,
336 .irq_set_type = exynos_wkup_irq_set_type,
339 /* interrupt handler for wakeup interrupts 0..15 */
340 static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
342 struct exynos_weint_data *eintd = irq_get_handler_data(irq);
343 struct samsung_pin_bank *bank = eintd->bank;
344 struct irq_chip *chip = irq_get_chip(irq);
347 chained_irq_enter(chip, desc);
348 chip->irq_mask(&desc->irq_data);
351 chip->irq_ack(&desc->irq_data);
353 eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
354 generic_handle_irq(eint_irq);
355 chip->irq_unmask(&desc->irq_data);
356 chained_irq_exit(chip, desc);
359 static inline void exynos_irq_demux_eint(unsigned long pend,
360 struct irq_domain *domain)
366 generic_handle_irq(irq_find_mapping(domain, irq));
371 /* interrupt handler for wakeup interrupt 16 */
372 static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
374 struct irq_chip *chip = irq_get_chip(irq);
375 struct exynos_muxed_weint_data *eintd = irq_get_handler_data(irq);
376 struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata;
377 struct samsung_pin_ctrl *ctrl = d->ctrl;
382 chained_irq_enter(chip, desc);
384 for (i = 0; i < eintd->nr_banks; ++i) {
385 struct samsung_pin_bank *b = eintd->banks[i];
386 pend = readl(d->virt_base + ctrl->weint_pend + b->eint_offset);
387 mask = readl(d->virt_base + ctrl->weint_mask + b->eint_offset);
388 exynos_irq_demux_eint(pend & ~mask, b->irq_domain);
391 chained_irq_exit(chip, desc);
394 static int exynos_wkup_irq_map(struct irq_domain *h, unsigned int virq,
397 irq_set_chip_and_handler(virq, &exynos_wkup_irq_chip, handle_level_irq);
398 irq_set_chip_data(virq, h->host_data);
399 set_irq_flags(virq, IRQF_VALID);
404 * irq domain callbacks for external wakeup interrupt controller.
406 static const struct irq_domain_ops exynos_wkup_irqd_ops = {
407 .map = exynos_wkup_irq_map,
408 .xlate = irq_domain_xlate_twocell,
412 * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
413 * @d: driver data of samsung pinctrl driver.
415 static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
417 struct device *dev = d->dev;
418 struct device_node *wkup_np = NULL;
419 struct device_node *np;
420 struct samsung_pin_bank *bank;
421 struct exynos_weint_data *weint_data;
422 struct exynos_muxed_weint_data *muxed_data;
423 unsigned int muxed_banks = 0;
427 for_each_child_of_node(dev->of_node, np) {
428 if (of_match_node(exynos_wkup_irq_ids, np)) {
436 bank = d->ctrl->pin_banks;
437 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
438 if (bank->eint_type != EINT_TYPE_WKUP)
441 bank->irq_domain = irq_domain_add_linear(bank->of_node,
442 bank->nr_pins, &exynos_wkup_irqd_ops, bank);
443 if (!bank->irq_domain) {
444 dev_err(dev, "wkup irq domain add failed\n");
448 if (!of_find_property(bank->of_node, "interrupts", NULL)) {
449 bank->eint_type = EINT_TYPE_WKUP_MUX;
454 weint_data = devm_kzalloc(dev, bank->nr_pins
455 * sizeof(*weint_data), GFP_KERNEL);
457 dev_err(dev, "could not allocate memory for weint_data\n");
461 for (idx = 0; idx < bank->nr_pins; ++idx) {
462 irq = irq_of_parse_and_map(bank->of_node, idx);
464 dev_err(dev, "irq number for eint-%s-%d not found\n",
468 weint_data[idx].irq = idx;
469 weint_data[idx].bank = bank;
470 irq_set_handler_data(irq, &weint_data[idx]);
471 irq_set_chained_handler(irq, exynos_irq_eint0_15);
478 irq = irq_of_parse_and_map(wkup_np, 0);
480 dev_err(dev, "irq number for muxed EINTs not found\n");
484 muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
485 + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
487 dev_err(dev, "could not allocate memory for muxed_data\n");
491 irq_set_chained_handler(irq, exynos_irq_demux_eint16_31);
492 irq_set_handler_data(irq, muxed_data);
494 bank = d->ctrl->pin_banks;
496 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
497 if (bank->eint_type != EINT_TYPE_WKUP_MUX)
500 muxed_data->banks[idx++] = bank;
502 muxed_data->nr_banks = muxed_banks;
507 /* pin banks of exynos4210 pin-controller 0 */
508 static struct samsung_pin_bank exynos4210_pin_banks0[] = {
509 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
510 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
511 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
512 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
513 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
514 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
515 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
516 EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
517 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
518 EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
519 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
520 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
521 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
522 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
523 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
524 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
527 /* pin banks of exynos4210 pin-controller 1 */
528 static struct samsung_pin_bank exynos4210_pin_banks1[] = {
529 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
530 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
531 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
532 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
533 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
534 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
535 EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
536 EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
537 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
538 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
539 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
540 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
541 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
542 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
543 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
544 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
545 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
546 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
547 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
548 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
551 /* pin banks of exynos4210 pin-controller 2 */
552 static struct samsung_pin_bank exynos4210_pin_banks2[] = {
553 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
557 * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
558 * three gpio/pin-mux/pinconfig controllers.
560 struct samsung_pin_ctrl exynos4210_pin_ctrl[] = {
562 /* pin-controller instance 0 data */
563 .pin_banks = exynos4210_pin_banks0,
564 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
565 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
566 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
567 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
568 .svc = EXYNOS_SVC_OFFSET,
569 .eint_gpio_init = exynos_eint_gpio_init,
570 .label = "exynos4210-gpio-ctrl0",
572 /* pin-controller instance 1 data */
573 .pin_banks = exynos4210_pin_banks1,
574 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
575 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
576 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
577 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
578 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
579 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
580 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
581 .svc = EXYNOS_SVC_OFFSET,
582 .eint_gpio_init = exynos_eint_gpio_init,
583 .eint_wkup_init = exynos_eint_wkup_init,
584 .label = "exynos4210-gpio-ctrl1",
586 /* pin-controller instance 2 data */
587 .pin_banks = exynos4210_pin_banks2,
588 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
589 .label = "exynos4210-gpio-ctrl2",
593 /* pin banks of exynos4x12 pin-controller 0 */
594 static struct samsung_pin_bank exynos4x12_pin_banks0[] = {
595 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
596 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
597 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
598 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
599 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
600 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
601 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
602 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
603 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
604 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
605 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
606 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
607 EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
610 /* pin banks of exynos4x12 pin-controller 1 */
611 static struct samsung_pin_bank exynos4x12_pin_banks1[] = {
612 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
613 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
614 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
615 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
616 EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
617 EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
618 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
619 EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
620 EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
621 EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
622 EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
623 EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
624 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
625 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
626 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
627 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
628 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
629 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
630 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
631 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
632 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
633 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
634 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
637 /* pin banks of exynos4x12 pin-controller 2 */
638 static struct samsung_pin_bank exynos4x12_pin_banks2[] = {
639 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
642 /* pin banks of exynos4x12 pin-controller 3 */
643 static struct samsung_pin_bank exynos4x12_pin_banks3[] = {
644 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
645 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
646 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
647 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
648 EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
652 * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
653 * four gpio/pin-mux/pinconfig controllers.
655 struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = {
657 /* pin-controller instance 0 data */
658 .pin_banks = exynos4x12_pin_banks0,
659 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks0),
660 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
661 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
662 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
663 .svc = EXYNOS_SVC_OFFSET,
664 .eint_gpio_init = exynos_eint_gpio_init,
665 .label = "exynos4x12-gpio-ctrl0",
667 /* pin-controller instance 1 data */
668 .pin_banks = exynos4x12_pin_banks1,
669 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks1),
670 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
671 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
672 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
673 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
674 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
675 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
676 .svc = EXYNOS_SVC_OFFSET,
677 .eint_gpio_init = exynos_eint_gpio_init,
678 .eint_wkup_init = exynos_eint_wkup_init,
679 .label = "exynos4x12-gpio-ctrl1",
681 /* pin-controller instance 2 data */
682 .pin_banks = exynos4x12_pin_banks2,
683 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks2),
684 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
685 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
686 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
687 .svc = EXYNOS_SVC_OFFSET,
688 .eint_gpio_init = exynos_eint_gpio_init,
689 .label = "exynos4x12-gpio-ctrl2",
691 /* pin-controller instance 3 data */
692 .pin_banks = exynos4x12_pin_banks3,
693 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks3),
694 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
695 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
696 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
697 .svc = EXYNOS_SVC_OFFSET,
698 .eint_gpio_init = exynos_eint_gpio_init,
699 .label = "exynos4x12-gpio-ctrl3",