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/irqchip/chained_irq.h>
27 #include <linux/of_irq.h>
29 #include <linux/slab.h>
30 #include <linux/spinlock.h>
31 #include <linux/err.h>
33 #include "pinctrl-samsung.h"
34 #include "pinctrl-exynos.h"
37 static struct samsung_pin_bank_type bank_type_off
= {
38 .fld_width
= { 4, 1, 2, 2, 2, 2, },
39 .reg_offset
= { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
42 static struct samsung_pin_bank_type bank_type_alive
= {
43 .fld_width
= { 4, 1, 2, 2, },
44 .reg_offset
= { 0x00, 0x04, 0x08, 0x0c, },
47 /* list of external wakeup controllers supported */
48 static const struct of_device_id exynos_wkup_irq_ids
[] = {
49 { .compatible
= "samsung,exynos4210-wakeup-eint", },
53 static void exynos_gpio_irq_mask(struct irq_data
*irqd
)
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
;
61 spin_lock_irqsave(&bank
->slock
, flags
);
63 mask
= readl(d
->virt_base
+ reg_mask
);
64 mask
|= 1 << irqd
->hwirq
;
65 writel(mask
, d
->virt_base
+ reg_mask
);
67 spin_unlock_irqrestore(&bank
->slock
, flags
);
70 static void exynos_gpio_irq_ack(struct irq_data
*irqd
)
72 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
73 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
74 unsigned long reg_pend
= d
->ctrl
->geint_pend
+ bank
->eint_offset
;
76 writel(1 << irqd
->hwirq
, d
->virt_base
+ reg_pend
);
79 static void exynos_gpio_irq_unmask(struct irq_data
*irqd
)
81 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
82 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
83 unsigned long reg_mask
= d
->ctrl
->geint_mask
+ bank
->eint_offset
;
88 * Ack level interrupts right before unmask
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
95 if (irqd_get_trigger_type(irqd
) & IRQ_TYPE_LEVEL_MASK
)
96 exynos_gpio_irq_ack(irqd
);
98 spin_lock_irqsave(&bank
->slock
, flags
);
100 mask
= readl(d
->virt_base
+ reg_mask
);
101 mask
&= ~(1 << irqd
->hwirq
);
102 writel(mask
, d
->virt_base
+ reg_mask
);
104 spin_unlock_irqrestore(&bank
->slock
, flags
);
107 static int exynos_gpio_irq_set_type(struct irq_data
*irqd
, unsigned int type
)
109 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
110 struct samsung_pin_bank_type
*bank_type
= bank
->type
;
111 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
112 struct samsung_pin_ctrl
*ctrl
= d
->ctrl
;
113 unsigned int pin
= irqd
->hwirq
;
114 unsigned int shift
= EXYNOS_EINT_CON_LEN
* pin
;
115 unsigned int con
, trig_type
;
116 unsigned long reg_con
= ctrl
->geint_con
+ bank
->eint_offset
;
121 case IRQ_TYPE_EDGE_RISING
:
122 trig_type
= EXYNOS_EINT_EDGE_RISING
;
124 case IRQ_TYPE_EDGE_FALLING
:
125 trig_type
= EXYNOS_EINT_EDGE_FALLING
;
127 case IRQ_TYPE_EDGE_BOTH
:
128 trig_type
= EXYNOS_EINT_EDGE_BOTH
;
130 case IRQ_TYPE_LEVEL_HIGH
:
131 trig_type
= EXYNOS_EINT_LEVEL_HIGH
;
133 case IRQ_TYPE_LEVEL_LOW
:
134 trig_type
= EXYNOS_EINT_LEVEL_LOW
;
137 pr_err("unsupported external interrupt type\n");
141 if (type
& IRQ_TYPE_EDGE_BOTH
)
142 __irq_set_handler_locked(irqd
->irq
, handle_edge_irq
);
144 __irq_set_handler_locked(irqd
->irq
, handle_level_irq
);
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
);
151 reg_con
= bank
->pctl_offset
+ bank_type
->reg_offset
[PINCFG_TYPE_FUNC
];
152 shift
= pin
* bank_type
->fld_width
[PINCFG_TYPE_FUNC
];
153 mask
= (1 << bank_type
->fld_width
[PINCFG_TYPE_FUNC
]) - 1;
155 spin_lock_irqsave(&bank
->slock
, flags
);
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
);
162 spin_unlock_irqrestore(&bank
->slock
, flags
);
168 * irq_chip for gpio interrupts.
170 static 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
,
178 static int exynos_gpio_irq_map(struct irq_domain
*h
, unsigned int virq
,
181 struct samsung_pin_bank
*b
= h
->host_data
;
183 irq_set_chip_data(virq
, b
);
184 irq_set_chip_and_handler(virq
, &exynos_gpio_irq_chip
,
186 set_irq_flags(virq
, IRQF_VALID
);
191 * irq domain callbacks for external gpio interrupt controller.
193 static const struct irq_domain_ops exynos_gpio_irqd_ops
= {
194 .map
= exynos_gpio_irq_map
,
195 .xlate
= irq_domain_xlate_twocell
,
198 static irqreturn_t
exynos_eint_gpio_irq(int irq
, void *data
)
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
;
205 svc
= readl(d
->virt_base
+ ctrl
->svc
);
206 group
= EXYNOS_SVC_GROUP(svc
);
207 pin
= svc
& EXYNOS_SVC_NUM_MASK
;
213 virq
= irq_linear_revmap(bank
->irq_domain
, pin
);
216 generic_handle_irq(virq
);
220 struct exynos_eint_gpio_save
{
227 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
228 * @d: driver data of samsung pinctrl driver.
230 static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data
*d
)
232 struct samsung_pin_bank
*bank
;
233 struct device
*dev
= d
->dev
;
238 dev_err(dev
, "irq number not available\n");
242 ret
= devm_request_irq(dev
, d
->irq
, exynos_eint_gpio_irq
,
243 0, dev_name(dev
), d
);
245 dev_err(dev
, "irq request failed\n");
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
)
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");
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
);
273 for (--i
, --bank
; i
>= 0; --i
, --bank
) {
274 if (bank
->eint_type
!= EINT_TYPE_GPIO
)
276 irq_domain_remove(bank
->irq_domain
);
282 static void exynos_wkup_irq_mask(struct irq_data
*irqd
)
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
;
290 spin_lock_irqsave(&b
->slock
, flags
);
292 mask
= readl(d
->virt_base
+ reg_mask
);
293 mask
|= 1 << irqd
->hwirq
;
294 writel(mask
, d
->virt_base
+ reg_mask
);
296 spin_unlock_irqrestore(&b
->slock
, flags
);
299 static void exynos_wkup_irq_ack(struct irq_data
*irqd
)
301 struct samsung_pin_bank
*b
= irq_data_get_irq_chip_data(irqd
);
302 struct samsung_pinctrl_drv_data
*d
= b
->drvdata
;
303 unsigned long pend
= d
->ctrl
->weint_pend
+ b
->eint_offset
;
305 writel(1 << irqd
->hwirq
, d
->virt_base
+ pend
);
308 static void exynos_wkup_irq_unmask(struct irq_data
*irqd
)
310 struct samsung_pin_bank
*b
= irq_data_get_irq_chip_data(irqd
);
311 struct samsung_pinctrl_drv_data
*d
= b
->drvdata
;
312 unsigned long reg_mask
= d
->ctrl
->weint_mask
+ b
->eint_offset
;
317 * Ack level interrupts right before unmask
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
324 if (irqd_get_trigger_type(irqd
) & IRQ_TYPE_LEVEL_MASK
)
325 exynos_wkup_irq_ack(irqd
);
327 spin_lock_irqsave(&b
->slock
, flags
);
329 mask
= readl(d
->virt_base
+ reg_mask
);
330 mask
&= ~(1 << irqd
->hwirq
);
331 writel(mask
, d
->virt_base
+ reg_mask
);
333 spin_unlock_irqrestore(&b
->slock
, flags
);
336 static int exynos_wkup_irq_set_type(struct irq_data
*irqd
, unsigned int type
)
338 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
339 struct samsung_pin_bank_type
*bank_type
= bank
->type
;
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
;
343 unsigned long shift
= EXYNOS_EINT_CON_LEN
* pin
;
344 unsigned long con
, trig_type
;
349 case IRQ_TYPE_EDGE_RISING
:
350 trig_type
= EXYNOS_EINT_EDGE_RISING
;
352 case IRQ_TYPE_EDGE_FALLING
:
353 trig_type
= EXYNOS_EINT_EDGE_FALLING
;
355 case IRQ_TYPE_EDGE_BOTH
:
356 trig_type
= EXYNOS_EINT_EDGE_BOTH
;
358 case IRQ_TYPE_LEVEL_HIGH
:
359 trig_type
= EXYNOS_EINT_LEVEL_HIGH
;
361 case IRQ_TYPE_LEVEL_LOW
:
362 trig_type
= EXYNOS_EINT_LEVEL_LOW
;
365 pr_err("unsupported external interrupt type\n");
369 if (type
& IRQ_TYPE_EDGE_BOTH
)
370 __irq_set_handler_locked(irqd
->irq
, handle_edge_irq
);
372 __irq_set_handler_locked(irqd
->irq
, handle_level_irq
);
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
);
379 reg_con
= bank
->pctl_offset
+ bank_type
->reg_offset
[PINCFG_TYPE_FUNC
];
380 shift
= pin
* bank_type
->fld_width
[PINCFG_TYPE_FUNC
];
381 mask
= (1 << bank_type
->fld_width
[PINCFG_TYPE_FUNC
]) - 1;
383 spin_lock_irqsave(&bank
->slock
, flags
);
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
);
390 spin_unlock_irqrestore(&bank
->slock
, flags
);
395 static u32 exynos_eint_wake_mask
= 0xffffffff;
397 u32
exynos_get_eint_wake_mask(void)
399 return exynos_eint_wake_mask
;
402 static int exynos_wkup_irq_set_wake(struct irq_data
*irqd
, unsigned int on
)
404 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
405 unsigned long bit
= 1UL << (2 * bank
->eint_offset
+ irqd
->hwirq
);
407 pr_info("wake %s for irq %d\n", on
? "enabled" : "disabled", irqd
->irq
);
410 exynos_eint_wake_mask
|= bit
;
412 exynos_eint_wake_mask
&= ~bit
;
418 * irq_chip for wakeup interrupts
420 static 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
,
426 .irq_set_wake
= exynos_wkup_irq_set_wake
,
429 /* interrupt handler for wakeup interrupts 0..15 */
430 static void exynos_irq_eint0_15(unsigned int irq
, struct irq_desc
*desc
)
432 struct exynos_weint_data
*eintd
= irq_get_handler_data(irq
);
433 struct samsung_pin_bank
*bank
= eintd
->bank
;
434 struct irq_chip
*chip
= irq_get_chip(irq
);
437 chained_irq_enter(chip
, desc
);
438 chip
->irq_mask(&desc
->irq_data
);
441 chip
->irq_ack(&desc
->irq_data
);
443 eint_irq
= irq_linear_revmap(bank
->irq_domain
, eintd
->irq
);
444 generic_handle_irq(eint_irq
);
445 chip
->irq_unmask(&desc
->irq_data
);
446 chained_irq_exit(chip
, desc
);
449 static inline void exynos_irq_demux_eint(unsigned long pend
,
450 struct irq_domain
*domain
)
456 generic_handle_irq(irq_find_mapping(domain
, irq
));
461 /* interrupt handler for wakeup interrupt 16 */
462 static void exynos_irq_demux_eint16_31(unsigned int irq
, struct irq_desc
*desc
)
464 struct irq_chip
*chip
= irq_get_chip(irq
);
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
;
472 chained_irq_enter(chip
, desc
);
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
);
481 chained_irq_exit(chip
, desc
);
484 static int exynos_wkup_irq_map(struct irq_domain
*h
, unsigned int virq
,
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
);
494 * irq domain callbacks for external wakeup interrupt controller.
496 static const struct irq_domain_ops exynos_wkup_irqd_ops
= {
497 .map
= exynos_wkup_irq_map
,
498 .xlate
= irq_domain_xlate_twocell
,
502 * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
503 * @d: driver data of samsung pinctrl driver.
505 static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data
*d
)
507 struct device
*dev
= d
->dev
;
508 struct device_node
*wkup_np
= NULL
;
509 struct device_node
*np
;
510 struct samsung_pin_bank
*bank
;
511 struct exynos_weint_data
*weint_data
;
512 struct exynos_muxed_weint_data
*muxed_data
;
513 unsigned int muxed_banks
= 0;
517 for_each_child_of_node(dev
->of_node
, np
) {
518 if (of_match_node(exynos_wkup_irq_ids
, np
)) {
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
)
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");
538 if (!of_find_property(bank
->of_node
, "interrupts", NULL
)) {
539 bank
->eint_type
= EINT_TYPE_WKUP_MUX
;
544 weint_data
= devm_kzalloc(dev
, bank
->nr_pins
545 * sizeof(*weint_data
), GFP_KERNEL
);
547 dev_err(dev
, "could not allocate memory for weint_data\n");
551 for (idx
= 0; idx
< bank
->nr_pins
; ++idx
) {
552 irq
= irq_of_parse_and_map(bank
->of_node
, idx
);
554 dev_err(dev
, "irq number for eint-%s-%d not found\n",
558 weint_data
[idx
].irq
= idx
;
559 weint_data
[idx
].bank
= bank
;
560 irq_set_handler_data(irq
, &weint_data
[idx
]);
561 irq_set_chained_handler(irq
, exynos_irq_eint0_15
);
568 irq
= irq_of_parse_and_map(wkup_np
, 0);
570 dev_err(dev
, "irq number for muxed EINTs not found\n");
574 muxed_data
= devm_kzalloc(dev
, sizeof(*muxed_data
)
575 + muxed_banks
*sizeof(struct samsung_pin_bank
*), GFP_KERNEL
);
577 dev_err(dev
, "could not allocate memory for muxed_data\n");
581 irq_set_chained_handler(irq
, exynos_irq_demux_eint16_31
);
582 irq_set_handler_data(irq
, muxed_data
);
584 bank
= d
->ctrl
->pin_banks
;
586 for (i
= 0; i
< d
->ctrl
->nr_banks
; ++i
, ++bank
) {
587 if (bank
->eint_type
!= EINT_TYPE_WKUP_MUX
)
590 muxed_data
->banks
[idx
++] = bank
;
592 muxed_data
->nr_banks
= muxed_banks
;
597 static void exynos_pinctrl_suspend_bank(
598 struct samsung_pinctrl_drv_data
*drvdata
,
599 struct samsung_pin_bank
*bank
)
601 struct exynos_eint_gpio_save
*save
= bank
->soc_priv
;
602 void __iomem
*regs
= drvdata
->virt_base
;
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);
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
);
616 static void exynos_pinctrl_suspend(struct samsung_pinctrl_drv_data
*drvdata
)
618 struct samsung_pin_ctrl
*ctrl
= drvdata
->ctrl
;
619 struct samsung_pin_bank
*bank
= ctrl
->pin_banks
;
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
);
627 static void exynos_pinctrl_resume_bank(
628 struct samsung_pinctrl_drv_data
*drvdata
,
629 struct samsung_pin_bank
*bank
)
631 struct exynos_eint_gpio_save
*save
= bank
->soc_priv
;
632 void __iomem
*regs
= drvdata
->virt_base
;
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
);
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);
652 static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data
*drvdata
)
654 struct samsung_pin_ctrl
*ctrl
= drvdata
->ctrl
;
655 struct samsung_pin_bank
*bank
= ctrl
->pin_banks
;
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
);
663 /* pin banks of s5pv210 pin-controller */
664 static struct samsung_pin_bank s5pv210_pin_bank
[] = {
665 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
666 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
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),
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),
675 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28),
676 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c),
677 EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30),
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),
701 struct samsung_pin_ctrl s5pv210_pin_ctrl
[] = {
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",
721 /* pin banks of exynos3250 pin-controller 0 */
722 static 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),
732 /* pin banks of exynos3250 pin-controller 1 */
733 static 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),
753 * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes
754 * two gpio/pin-mux/pinconfig controllers.
756 struct samsung_pin_ctrl exynos3250_pin_ctrl
[] = {
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",
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",
788 /* pin banks of exynos4210 pin-controller 0 */
789 static struct samsung_pin_bank exynos4210_pin_banks0
[] = {
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),
808 /* pin banks of exynos4210 pin-controller 1 */
809 static struct samsung_pin_bank exynos4210_pin_banks1
[] = {
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),
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"),
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),
832 /* pin banks of exynos4210 pin-controller 2 */
833 static struct samsung_pin_bank exynos4210_pin_banks2
[] = {
834 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
838 * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
839 * three gpio/pin-mux/pinconfig controllers.
841 struct samsung_pin_ctrl exynos4210_pin_ctrl
[] = {
843 /* pin-controller instance 0 data */
844 .pin_banks
= exynos4210_pin_banks0
,
845 .nr_banks
= ARRAY_SIZE(exynos4210_pin_banks0
),
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
,
851 .suspend
= exynos_pinctrl_suspend
,
852 .resume
= exynos_pinctrl_resume
,
853 .label
= "exynos4210-gpio-ctrl0",
855 /* pin-controller instance 1 data */
856 .pin_banks
= exynos4210_pin_banks1
,
857 .nr_banks
= ARRAY_SIZE(exynos4210_pin_banks1
),
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
,
867 .suspend
= exynos_pinctrl_suspend
,
868 .resume
= exynos_pinctrl_resume
,
869 .label
= "exynos4210-gpio-ctrl1",
871 /* pin-controller instance 2 data */
872 .pin_banks
= exynos4210_pin_banks2
,
873 .nr_banks
= ARRAY_SIZE(exynos4210_pin_banks2
),
874 .label
= "exynos4210-gpio-ctrl2",
878 /* pin banks of exynos4x12 pin-controller 0 */
879 static 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),
895 /* pin banks of exynos4x12 pin-controller 1 */
896 static 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),
922 /* pin banks of exynos4x12 pin-controller 2 */
923 static struct samsung_pin_bank exynos4x12_pin_banks2
[] = {
924 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
927 /* pin banks of exynos4x12 pin-controller 3 */
928 static 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),
937 * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
938 * four gpio/pin-mux/pinconfig controllers.
940 struct samsung_pin_ctrl exynos4x12_pin_ctrl
[] = {
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
,
950 .suspend
= exynos_pinctrl_suspend
,
951 .resume
= exynos_pinctrl_resume
,
952 .label
= "exynos4x12-gpio-ctrl0",
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
,
966 .suspend
= exynos_pinctrl_suspend
,
967 .resume
= exynos_pinctrl_resume
,
968 .label
= "exynos4x12-gpio-ctrl1",
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
,
978 .suspend
= exynos_pinctrl_suspend
,
979 .resume
= exynos_pinctrl_resume
,
980 .label
= "exynos4x12-gpio-ctrl2",
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
,
990 .suspend
= exynos_pinctrl_suspend
,
991 .resume
= exynos_pinctrl_resume
,
992 .label
= "exynos4x12-gpio-ctrl3",
996 /* pin banks of exynos5250 pin-controller 0 */
997 static 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),
1025 /* pin banks of exynos5250 pin-controller 1 */
1026 static 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),
1038 /* pin banks of exynos5250 pin-controller 2 */
1039 static 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),
1047 /* pin banks of exynos5250 pin-controller 3 */
1048 static struct samsung_pin_bank exynos5250_pin_banks3
[] = {
1049 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
1053 * Samsung pinctrl driver data for Exynos5250 SoC. Exynos5250 SoC includes
1054 * four gpio/pin-mux/pinconfig controllers.
1056 struct samsung_pin_ctrl exynos5250_pin_ctrl
[] = {
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
,
1070 .suspend
= exynos_pinctrl_suspend
,
1071 .resume
= exynos_pinctrl_resume
,
1072 .label
= "exynos5250-gpio-ctrl0",
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
,
1082 .suspend
= exynos_pinctrl_suspend
,
1083 .resume
= exynos_pinctrl_resume
,
1084 .label
= "exynos5250-gpio-ctrl1",
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
,
1094 .suspend
= exynos_pinctrl_suspend
,
1095 .resume
= exynos_pinctrl_resume
,
1096 .label
= "exynos5250-gpio-ctrl2",
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
,
1106 .suspend
= exynos_pinctrl_suspend
,
1107 .resume
= exynos_pinctrl_resume
,
1108 .label
= "exynos5250-gpio-ctrl3",
1112 /* pin banks of exynos5260 pin-controller 0 */
1113 static 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),
1137 /* pin banks of exynos5260 pin-controller 1 */
1138 static 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),
1146 /* pin banks of exynos5260 pin-controller 2 */
1147 static 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),
1153 * Samsung pinctrl driver data for Exynos5260 SoC. Exynos5260 SoC includes
1154 * three gpio/pin-mux/pinconfig controllers.
1156 struct samsung_pin_ctrl exynos5260_pin_ctrl
[] = {
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",
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",
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",
1194 /* pin banks of exynos5420 pin-controller 0 */
1195 static 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),
1203 /* pin banks of exynos5420 pin-controller 1 */
1204 static 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"),
1220 /* pin banks of exynos5420 pin-controller 2 */
1221 static 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),
1232 /* pin banks of exynos5420 pin-controller 3 */
1233 static 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),
1245 /* pin banks of exynos5420 pin-controller 4 */
1246 static struct samsung_pin_bank exynos5420_pin_banks4
[] = {
1247 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
1251 * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes
1252 * four gpio/pin-mux/pinconfig controllers.
1254 struct samsung_pin_ctrl exynos5420_pin_ctrl
[] = {
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",
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",
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",
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",
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",