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"
37 /* list of external wakeup controllers supported */
38 static const struct of_device_id exynos_wkup_irq_ids[] = {
39 { .compatible = "samsung,exynos4210-wakeup-eint", },
43 static void exynos_gpio_irq_unmask(struct irq_data *irqd)
45 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
46 struct samsung_pinctrl_drv_data *d = bank->drvdata;
47 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
50 mask = readl(d->virt_base + reg_mask);
51 mask &= ~(1 << irqd->hwirq);
52 writel(mask, d->virt_base + reg_mask);
55 static void exynos_gpio_irq_mask(struct irq_data *irqd)
57 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
58 struct samsung_pinctrl_drv_data *d = bank->drvdata;
59 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
62 mask = readl(d->virt_base + reg_mask);
63 mask |= 1 << irqd->hwirq;
64 writel(mask, d->virt_base + reg_mask);
67 static void exynos_gpio_irq_ack(struct irq_data *irqd)
69 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
70 struct samsung_pinctrl_drv_data *d = bank->drvdata;
71 unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
73 writel(1 << irqd->hwirq, d->virt_base + reg_pend);
76 static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
78 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
79 struct samsung_pinctrl_drv_data *d = bank->drvdata;
80 struct samsung_pin_ctrl *ctrl = d->ctrl;
81 unsigned int pin = irqd->hwirq;
82 unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
83 unsigned int con, trig_type;
84 unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
89 case IRQ_TYPE_EDGE_RISING:
90 trig_type = EXYNOS_EINT_EDGE_RISING;
92 case IRQ_TYPE_EDGE_FALLING:
93 trig_type = EXYNOS_EINT_EDGE_FALLING;
95 case IRQ_TYPE_EDGE_BOTH:
96 trig_type = EXYNOS_EINT_EDGE_BOTH;
98 case IRQ_TYPE_LEVEL_HIGH:
99 trig_type = EXYNOS_EINT_LEVEL_HIGH;
101 case IRQ_TYPE_LEVEL_LOW:
102 trig_type = EXYNOS_EINT_LEVEL_LOW;
105 pr_err("unsupported external interrupt type\n");
109 if (type & IRQ_TYPE_EDGE_BOTH)
110 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
112 __irq_set_handler_locked(irqd->irq, handle_level_irq);
114 con = readl(d->virt_base + reg_con);
115 con &= ~(EXYNOS_EINT_CON_MASK << shift);
116 con |= trig_type << shift;
117 writel(con, d->virt_base + reg_con);
119 reg_con = bank->pctl_offset;
120 shift = pin * bank->func_width;
121 mask = (1 << bank->func_width) - 1;
123 spin_lock_irqsave(&bank->slock, flags);
125 con = readl(d->virt_base + reg_con);
126 con &= ~(mask << shift);
127 con |= EXYNOS_EINT_FUNC << shift;
128 writel(con, d->virt_base + reg_con);
130 spin_unlock_irqrestore(&bank->slock, flags);
136 * irq_chip for gpio interrupts.
138 static struct irq_chip exynos_gpio_irq_chip = {
139 .name = "exynos_gpio_irq_chip",
140 .irq_unmask = exynos_gpio_irq_unmask,
141 .irq_mask = exynos_gpio_irq_mask,
142 .irq_ack = exynos_gpio_irq_ack,
143 .irq_set_type = exynos_gpio_irq_set_type,
146 static int exynos_gpio_irq_map(struct irq_domain *h, unsigned int virq,
149 struct samsung_pin_bank *b = h->host_data;
151 irq_set_chip_data(virq, b);
152 irq_set_chip_and_handler(virq, &exynos_gpio_irq_chip,
154 set_irq_flags(virq, IRQF_VALID);
159 * irq domain callbacks for external gpio interrupt controller.
161 static const struct irq_domain_ops exynos_gpio_irqd_ops = {
162 .map = exynos_gpio_irq_map,
163 .xlate = irq_domain_xlate_twocell,
166 static irqreturn_t exynos_eint_gpio_irq(int irq, void *data)
168 struct samsung_pinctrl_drv_data *d = data;
169 struct samsung_pin_ctrl *ctrl = d->ctrl;
170 struct samsung_pin_bank *bank = ctrl->pin_banks;
171 unsigned int svc, group, pin, virq;
173 svc = readl(d->virt_base + ctrl->svc);
174 group = EXYNOS_SVC_GROUP(svc);
175 pin = svc & EXYNOS_SVC_NUM_MASK;
181 virq = irq_linear_revmap(bank->irq_domain, pin);
184 generic_handle_irq(virq);
189 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
190 * @d: driver data of samsung pinctrl driver.
192 static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
194 struct samsung_pin_bank *bank;
195 struct device *dev = d->dev;
200 dev_err(dev, "irq number not available\n");
204 ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
205 0, dev_name(dev), d);
207 dev_err(dev, "irq request failed\n");
211 bank = d->ctrl->pin_banks;
212 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
213 if (bank->eint_type != EINT_TYPE_GPIO)
215 bank->irq_domain = irq_domain_add_linear(bank->of_node,
216 bank->nr_pins, &exynos_gpio_irqd_ops, bank);
217 if (!bank->irq_domain) {
218 dev_err(dev, "gpio irq domain add failed\n");
226 static void exynos_wkup_irq_unmask(struct irq_data *irqd)
228 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
229 struct samsung_pinctrl_drv_data *d = b->drvdata;
230 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
233 mask = readl(d->virt_base + reg_mask);
234 mask &= ~(1 << irqd->hwirq);
235 writel(mask, d->virt_base + reg_mask);
238 static void exynos_wkup_irq_mask(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_ack(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 pend = d->ctrl->weint_pend + b->eint_offset;
256 writel(1 << irqd->hwirq, d->virt_base + pend);
259 static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
261 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
262 struct samsung_pinctrl_drv_data *d = bank->drvdata;
263 unsigned int pin = irqd->hwirq;
264 unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
265 unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
266 unsigned long con, trig_type;
271 case IRQ_TYPE_EDGE_RISING:
272 trig_type = EXYNOS_EINT_EDGE_RISING;
274 case IRQ_TYPE_EDGE_FALLING:
275 trig_type = EXYNOS_EINT_EDGE_FALLING;
277 case IRQ_TYPE_EDGE_BOTH:
278 trig_type = EXYNOS_EINT_EDGE_BOTH;
280 case IRQ_TYPE_LEVEL_HIGH:
281 trig_type = EXYNOS_EINT_LEVEL_HIGH;
283 case IRQ_TYPE_LEVEL_LOW:
284 trig_type = EXYNOS_EINT_LEVEL_LOW;
287 pr_err("unsupported external interrupt type\n");
291 if (type & IRQ_TYPE_EDGE_BOTH)
292 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
294 __irq_set_handler_locked(irqd->irq, handle_level_irq);
296 con = readl(d->virt_base + reg_con);
297 con &= ~(EXYNOS_EINT_CON_MASK << shift);
298 con |= trig_type << shift;
299 writel(con, d->virt_base + reg_con);
301 reg_con = bank->pctl_offset;
302 shift = pin * bank->func_width;
303 mask = (1 << bank->func_width) - 1;
305 spin_lock_irqsave(&bank->slock, flags);
307 con = readl(d->virt_base + reg_con);
308 con &= ~(mask << shift);
309 con |= EXYNOS_EINT_FUNC << shift;
310 writel(con, d->virt_base + reg_con);
312 spin_unlock_irqrestore(&bank->slock, flags);
318 * irq_chip for wakeup interrupts
320 static struct irq_chip exynos_wkup_irq_chip = {
321 .name = "exynos_wkup_irq_chip",
322 .irq_unmask = exynos_wkup_irq_unmask,
323 .irq_mask = exynos_wkup_irq_mask,
324 .irq_ack = exynos_wkup_irq_ack,
325 .irq_set_type = exynos_wkup_irq_set_type,
328 /* interrupt handler for wakeup interrupts 0..15 */
329 static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
331 struct exynos_weint_data *eintd = irq_get_handler_data(irq);
332 struct samsung_pin_bank *bank = eintd->bank;
333 struct irq_chip *chip = irq_get_chip(irq);
336 chained_irq_enter(chip, desc);
337 chip->irq_mask(&desc->irq_data);
340 chip->irq_ack(&desc->irq_data);
342 eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
343 generic_handle_irq(eint_irq);
344 chip->irq_unmask(&desc->irq_data);
345 chained_irq_exit(chip, desc);
348 static inline void exynos_irq_demux_eint(unsigned long pend,
349 struct irq_domain *domain)
355 generic_handle_irq(irq_find_mapping(domain, irq));
360 /* interrupt handler for wakeup interrupt 16 */
361 static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
363 struct irq_chip *chip = irq_get_chip(irq);
364 struct exynos_muxed_weint_data *eintd = irq_get_handler_data(irq);
365 struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata;
366 struct samsung_pin_ctrl *ctrl = d->ctrl;
371 chained_irq_enter(chip, desc);
373 for (i = 0; i < eintd->nr_banks; ++i) {
374 struct samsung_pin_bank *b = eintd->banks[i];
375 pend = readl(d->virt_base + ctrl->weint_pend + b->eint_offset);
376 mask = readl(d->virt_base + ctrl->weint_mask + b->eint_offset);
377 exynos_irq_demux_eint(pend & ~mask, b->irq_domain);
380 chained_irq_exit(chip, desc);
383 static int exynos_wkup_irq_map(struct irq_domain *h, unsigned int virq,
386 irq_set_chip_and_handler(virq, &exynos_wkup_irq_chip, handle_level_irq);
387 irq_set_chip_data(virq, h->host_data);
388 set_irq_flags(virq, IRQF_VALID);
393 * irq domain callbacks for external wakeup interrupt controller.
395 static const struct irq_domain_ops exynos_wkup_irqd_ops = {
396 .map = exynos_wkup_irq_map,
397 .xlate = irq_domain_xlate_twocell,
401 * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
402 * @d: driver data of samsung pinctrl driver.
404 static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
406 struct device *dev = d->dev;
407 struct device_node *wkup_np = NULL;
408 struct device_node *np;
409 struct samsung_pin_bank *bank;
410 struct exynos_weint_data *weint_data;
411 struct exynos_muxed_weint_data *muxed_data;
412 unsigned int muxed_banks = 0;
416 for_each_child_of_node(dev->of_node, np) {
417 if (of_match_node(exynos_wkup_irq_ids, np)) {
425 bank = d->ctrl->pin_banks;
426 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
427 if (bank->eint_type != EINT_TYPE_WKUP)
430 bank->irq_domain = irq_domain_add_linear(bank->of_node,
431 bank->nr_pins, &exynos_wkup_irqd_ops, bank);
432 if (!bank->irq_domain) {
433 dev_err(dev, "wkup irq domain add failed\n");
437 if (!of_find_property(bank->of_node, "interrupts", NULL)) {
438 bank->eint_type = EINT_TYPE_WKUP_MUX;
443 weint_data = devm_kzalloc(dev, bank->nr_pins
444 * sizeof(*weint_data), GFP_KERNEL);
446 dev_err(dev, "could not allocate memory for weint_data\n");
450 for (idx = 0; idx < bank->nr_pins; ++idx) {
451 irq = irq_of_parse_and_map(bank->of_node, idx);
453 dev_err(dev, "irq number for eint-%s-%d not found\n",
457 weint_data[idx].irq = idx;
458 weint_data[idx].bank = bank;
459 irq_set_handler_data(irq, &weint_data[idx]);
460 irq_set_chained_handler(irq, exynos_irq_eint0_15);
467 irq = irq_of_parse_and_map(wkup_np, 0);
469 dev_err(dev, "irq number for muxed EINTs not found\n");
473 muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
474 + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
476 dev_err(dev, "could not allocate memory for muxed_data\n");
480 irq_set_chained_handler(irq, exynos_irq_demux_eint16_31);
481 irq_set_handler_data(irq, muxed_data);
483 bank = d->ctrl->pin_banks;
485 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
486 if (bank->eint_type != EINT_TYPE_WKUP_MUX)
489 muxed_data->banks[idx++] = bank;
491 muxed_data->nr_banks = muxed_banks;
496 /* pin banks of exynos4210 pin-controller 0 */
497 static struct samsung_pin_bank exynos4210_pin_banks0[] = {
498 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
499 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
500 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
501 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
502 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
503 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
504 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
505 EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
506 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
507 EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
508 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
509 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
510 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
511 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
512 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
513 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
516 /* pin banks of exynos4210 pin-controller 1 */
517 static struct samsung_pin_bank exynos4210_pin_banks1[] = {
518 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
519 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
520 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
521 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
522 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
523 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
524 EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
525 EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
526 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
527 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
528 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
529 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
530 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
531 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
532 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
533 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
534 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
535 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
536 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
537 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
540 /* pin banks of exynos4210 pin-controller 2 */
541 static struct samsung_pin_bank exynos4210_pin_banks2[] = {
542 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
546 * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
547 * three gpio/pin-mux/pinconfig controllers.
549 struct samsung_pin_ctrl exynos4210_pin_ctrl[] = {
551 /* pin-controller instance 0 data */
552 .pin_banks = exynos4210_pin_banks0,
553 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
554 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
555 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
556 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
557 .svc = EXYNOS_SVC_OFFSET,
558 .eint_gpio_init = exynos_eint_gpio_init,
559 .label = "exynos4210-gpio-ctrl0",
561 /* pin-controller instance 1 data */
562 .pin_banks = exynos4210_pin_banks1,
563 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
564 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
565 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
566 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
567 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
568 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
569 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
570 .svc = EXYNOS_SVC_OFFSET,
571 .eint_gpio_init = exynos_eint_gpio_init,
572 .eint_wkup_init = exynos_eint_wkup_init,
573 .label = "exynos4210-gpio-ctrl1",
575 /* pin-controller instance 2 data */
576 .pin_banks = exynos4210_pin_banks2,
577 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
578 .label = "exynos4210-gpio-ctrl2",
582 /* pin banks of exynos4x12 pin-controller 0 */
583 static struct samsung_pin_bank exynos4x12_pin_banks0[] = {
584 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
585 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
586 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
587 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
588 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
589 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
590 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
591 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
592 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
593 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
594 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
595 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
596 EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
599 /* pin banks of exynos4x12 pin-controller 1 */
600 static struct samsung_pin_bank exynos4x12_pin_banks1[] = {
601 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
602 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
603 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
604 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
605 EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
606 EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
607 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
608 EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
609 EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
610 EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
611 EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
612 EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
613 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
614 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
615 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
616 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
617 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
618 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
619 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
620 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
621 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
622 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
623 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
626 /* pin banks of exynos4x12 pin-controller 2 */
627 static struct samsung_pin_bank exynos4x12_pin_banks2[] = {
628 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
631 /* pin banks of exynos4x12 pin-controller 3 */
632 static struct samsung_pin_bank exynos4x12_pin_banks3[] = {
633 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
634 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
635 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
636 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
637 EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
641 * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
642 * four gpio/pin-mux/pinconfig controllers.
644 struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = {
646 /* pin-controller instance 0 data */
647 .pin_banks = exynos4x12_pin_banks0,
648 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks0),
649 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
650 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
651 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
652 .svc = EXYNOS_SVC_OFFSET,
653 .eint_gpio_init = exynos_eint_gpio_init,
654 .label = "exynos4x12-gpio-ctrl0",
656 /* pin-controller instance 1 data */
657 .pin_banks = exynos4x12_pin_banks1,
658 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks1),
659 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
660 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
661 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
662 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
663 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
664 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
665 .svc = EXYNOS_SVC_OFFSET,
666 .eint_gpio_init = exynos_eint_gpio_init,
667 .eint_wkup_init = exynos_eint_wkup_init,
668 .label = "exynos4x12-gpio-ctrl1",
670 /* pin-controller instance 2 data */
671 .pin_banks = exynos4x12_pin_banks2,
672 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks2),
673 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
674 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
675 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
676 .svc = EXYNOS_SVC_OFFSET,
677 .eint_gpio_init = exynos_eint_gpio_init,
678 .label = "exynos4x12-gpio-ctrl2",
680 /* pin-controller instance 3 data */
681 .pin_banks = exynos4x12_pin_banks3,
682 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks3),
683 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
684 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
685 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
686 .svc = EXYNOS_SVC_OFFSET,
687 .eint_gpio_init = exynos_eint_gpio_init,
688 .label = "exynos4x12-gpio-ctrl3",