1 // SPDX-License-Identifier: GPL-2.0+
3 // S3C64xx specific support for pinctrl-samsung driver.
5 // Copyright (c) 2013 Tomasz Figa <tomasz.figa@gmail.com>
7 // Based on pinctrl-exynos.c, please see the file for original copyrights.
9 // This file contains the Samsung S3C64xx specific information required by the
10 // the Samsung pinctrl/gpiolib driver. It also includes the implementation of
11 // external gpio and wakeup interrupt support.
13 #include <linux/init.h>
14 #include <linux/device.h>
15 #include <linux/interrupt.h>
16 #include <linux/irqdomain.h>
17 #include <linux/irq.h>
18 #include <linux/of_irq.h>
20 #include <linux/irqchip/chained_irq.h>
21 #include <linux/slab.h>
22 #include <linux/err.h>
24 #include "pinctrl-samsung.h"
27 #define NUM_EINT0_IRQ 4
28 #define EINT_MAX_PER_REG 16
29 #define EINT_MAX_PER_GROUP 16
31 /* External GPIO and wakeup interrupt related definitions */
32 #define SVC_GROUP_SHIFT 4
33 #define SVC_GROUP_MASK 0xf
34 #define SVC_NUM_MASK 0xf
35 #define SVC_GROUP(x) ((x >> SVC_GROUP_SHIFT) & \
38 #define EINT12CON_REG 0x200
39 #define EINT12MASK_REG 0x240
40 #define EINT12PEND_REG 0x260
42 #define EINT_OFFS(i) ((i) % (2 * EINT_MAX_PER_GROUP))
43 #define EINT_GROUP(i) ((i) / EINT_MAX_PER_GROUP)
44 #define EINT_REG(g) (4 * ((g) / 2))
46 #define EINTCON_REG(i) (EINT12CON_REG + EINT_REG(EINT_GROUP(i)))
47 #define EINTMASK_REG(i) (EINT12MASK_REG + EINT_REG(EINT_GROUP(i)))
48 #define EINTPEND_REG(i) (EINT12PEND_REG + EINT_REG(EINT_GROUP(i)))
50 #define SERVICE_REG 0x284
51 #define SERVICEPEND_REG 0x288
53 #define EINT0CON0_REG 0x900
54 #define EINT0MASK_REG 0x920
55 #define EINT0PEND_REG 0x924
57 /* S3C64xx specific external interrupt trigger types */
58 #define EINT_LEVEL_LOW 0
59 #define EINT_LEVEL_HIGH 1
60 #define EINT_EDGE_FALLING 2
61 #define EINT_EDGE_RISING 4
62 #define EINT_EDGE_BOTH 6
63 #define EINT_CON_MASK 0xF
64 #define EINT_CON_LEN 4
66 #define S3C_PIN_PULL_DISABLE 0
67 #define S3C_PIN_PULL_DOWN 1
68 #define S3C_PIN_PULL_UP 2
70 static const struct samsung_pin_bank_type bank_type_4bit_off
= {
71 .fld_width
= { 4, 1, 2, 0, 2, 2, },
72 .reg_offset
= { 0x00, 0x04, 0x08, 0, 0x0c, 0x10, },
75 static const struct samsung_pin_bank_type bank_type_4bit_alive
= {
76 .fld_width
= { 4, 1, 2, },
77 .reg_offset
= { 0x00, 0x04, 0x08, },
80 static const struct samsung_pin_bank_type bank_type_4bit2_off
= {
81 .fld_width
= { 4, 1, 2, 0, 2, 2, },
82 .reg_offset
= { 0x00, 0x08, 0x0c, 0, 0x10, 0x14, },
85 static const struct samsung_pin_bank_type bank_type_4bit2_alive
= {
86 .fld_width
= { 4, 1, 2, },
87 .reg_offset
= { 0x00, 0x08, 0x0c, },
90 static const struct samsung_pin_bank_type bank_type_2bit_off
= {
91 .fld_width
= { 2, 1, 2, 0, 2, 2, },
92 .reg_offset
= { 0x00, 0x04, 0x08, 0, 0x0c, 0x10, },
95 static const struct samsung_pin_bank_type bank_type_2bit_alive
= {
96 .fld_width
= { 2, 1, 2, },
97 .reg_offset
= { 0x00, 0x04, 0x08, },
100 #define PIN_BANK_4BIT(pins, reg, id) \
102 .type = &bank_type_4bit_off, \
103 .pctl_offset = reg, \
105 .eint_type = EINT_TYPE_NONE, \
109 #define PIN_BANK_4BIT_EINTG(pins, reg, id, eoffs) \
111 .type = &bank_type_4bit_off, \
112 .pctl_offset = reg, \
114 .eint_type = EINT_TYPE_GPIO, \
116 .eint_mask = (1 << (pins)) - 1, \
117 .eint_offset = eoffs, \
121 #define PIN_BANK_4BIT_EINTW(pins, reg, id, eoffs, emask) \
123 .type = &bank_type_4bit_alive,\
124 .pctl_offset = reg, \
126 .eint_type = EINT_TYPE_WKUP, \
128 .eint_mask = emask, \
129 .eint_offset = eoffs, \
133 #define PIN_BANK_4BIT2_EINTG(pins, reg, id, eoffs) \
135 .type = &bank_type_4bit2_off, \
136 .pctl_offset = reg, \
138 .eint_type = EINT_TYPE_GPIO, \
140 .eint_mask = (1 << (pins)) - 1, \
141 .eint_offset = eoffs, \
145 #define PIN_BANK_4BIT2_EINTW(pins, reg, id, eoffs, emask) \
147 .type = &bank_type_4bit2_alive,\
148 .pctl_offset = reg, \
150 .eint_type = EINT_TYPE_WKUP, \
152 .eint_mask = emask, \
153 .eint_offset = eoffs, \
157 #define PIN_BANK_4BIT2_ALIVE(pins, reg, id) \
159 .type = &bank_type_4bit2_alive,\
160 .pctl_offset = reg, \
162 .eint_type = EINT_TYPE_NONE, \
166 #define PIN_BANK_2BIT(pins, reg, id) \
168 .type = &bank_type_2bit_off, \
169 .pctl_offset = reg, \
171 .eint_type = EINT_TYPE_NONE, \
175 #define PIN_BANK_2BIT_EINTG(pins, reg, id, eoffs, emask) \
177 .type = &bank_type_2bit_off, \
178 .pctl_offset = reg, \
180 .eint_type = EINT_TYPE_GPIO, \
182 .eint_mask = emask, \
183 .eint_offset = eoffs, \
187 #define PIN_BANK_2BIT_EINTW(pins, reg, id, eoffs) \
189 .type = &bank_type_2bit_alive,\
190 .pctl_offset = reg, \
192 .eint_type = EINT_TYPE_WKUP, \
194 .eint_mask = (1 << (pins)) - 1, \
195 .eint_offset = eoffs, \
200 * struct s3c64xx_eint0_data - EINT0 common data
201 * @drvdata: pin controller driver data
202 * @domains: IRQ domains of particular EINT0 interrupts
203 * @pins: pin offsets inside of banks of particular EINT0 interrupts
205 struct s3c64xx_eint0_data
{
206 struct samsung_pinctrl_drv_data
*drvdata
;
207 struct irq_domain
*domains
[NUM_EINT0
];
212 * struct s3c64xx_eint0_domain_data - EINT0 per-domain data
213 * @bank: pin bank related to the domain
214 * @eints: EINT0 interrupts related to the domain
216 struct s3c64xx_eint0_domain_data
{
217 struct samsung_pin_bank
*bank
;
222 * struct s3c64xx_eint_gpio_data - GPIO EINT data
223 * @drvdata: pin controller driver data
224 * @domains: array of domains related to EINT interrupt groups
226 struct s3c64xx_eint_gpio_data
{
227 struct samsung_pinctrl_drv_data
*drvdata
;
228 struct irq_domain
*domains
[];
232 * Common functions for S3C64xx EINT configuration
235 static int s3c64xx_irq_get_trigger(unsigned int type
)
240 case IRQ_TYPE_EDGE_RISING
:
241 trigger
= EINT_EDGE_RISING
;
243 case IRQ_TYPE_EDGE_FALLING
:
244 trigger
= EINT_EDGE_FALLING
;
246 case IRQ_TYPE_EDGE_BOTH
:
247 trigger
= EINT_EDGE_BOTH
;
249 case IRQ_TYPE_LEVEL_HIGH
:
250 trigger
= EINT_LEVEL_HIGH
;
252 case IRQ_TYPE_LEVEL_LOW
:
253 trigger
= EINT_LEVEL_LOW
;
262 static void s3c64xx_pud_value_init(struct samsung_pinctrl_drv_data
*drvdata
)
264 unsigned int *pud_val
= drvdata
->pud_val
;
266 pud_val
[PUD_PULL_DISABLE
] = S3C_PIN_PULL_DISABLE
;
267 pud_val
[PUD_PULL_DOWN
] = S3C_PIN_PULL_DOWN
;
268 pud_val
[PUD_PULL_UP
] = S3C_PIN_PULL_UP
;
271 static void s3c64xx_irq_set_handler(struct irq_data
*d
, unsigned int type
)
273 /* Edge- and level-triggered interrupts need different handlers */
274 if (type
& IRQ_TYPE_EDGE_BOTH
)
275 irq_set_handler_locked(d
, handle_edge_irq
);
277 irq_set_handler_locked(d
, handle_level_irq
);
280 static void s3c64xx_irq_set_function(struct samsung_pinctrl_drv_data
*d
,
281 struct samsung_pin_bank
*bank
, int pin
)
283 const struct samsung_pin_bank_type
*bank_type
= bank
->type
;
290 /* Make sure that pin is configured as interrupt */
291 reg
= d
->virt_base
+ bank
->pctl_offset
;
293 if (bank_type
->fld_width
[PINCFG_TYPE_FUNC
] * shift
>= 32) {
294 /* 4-bit bank type with 2 con regs */
299 shift
= shift
* bank_type
->fld_width
[PINCFG_TYPE_FUNC
];
300 mask
= (1 << bank_type
->fld_width
[PINCFG_TYPE_FUNC
]) - 1;
302 raw_spin_lock_irqsave(&bank
->slock
, flags
);
305 val
&= ~(mask
<< shift
);
306 val
|= bank
->eint_func
<< shift
;
309 raw_spin_unlock_irqrestore(&bank
->slock
, flags
);
313 * Functions for EINT GPIO configuration (EINT groups 1-9)
316 static inline void s3c64xx_gpio_irq_set_mask(struct irq_data
*irqd
, bool mask
)
318 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
319 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
320 unsigned char index
= EINT_OFFS(bank
->eint_offset
) + irqd
->hwirq
;
321 void __iomem
*reg
= d
->virt_base
+ EINTMASK_REG(bank
->eint_offset
);
328 val
&= ~(1 << index
);
332 static void s3c64xx_gpio_irq_unmask(struct irq_data
*irqd
)
334 s3c64xx_gpio_irq_set_mask(irqd
, false);
337 static void s3c64xx_gpio_irq_mask(struct irq_data
*irqd
)
339 s3c64xx_gpio_irq_set_mask(irqd
, true);
342 static void s3c64xx_gpio_irq_ack(struct irq_data
*irqd
)
344 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
345 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
346 unsigned char index
= EINT_OFFS(bank
->eint_offset
) + irqd
->hwirq
;
347 void __iomem
*reg
= d
->virt_base
+ EINTPEND_REG(bank
->eint_offset
);
349 writel(1 << index
, reg
);
352 static int s3c64xx_gpio_irq_set_type(struct irq_data
*irqd
, unsigned int type
)
354 struct samsung_pin_bank
*bank
= irq_data_get_irq_chip_data(irqd
);
355 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
361 trigger
= s3c64xx_irq_get_trigger(type
);
363 pr_err("unsupported external interrupt type\n");
367 s3c64xx_irq_set_handler(irqd
, type
);
369 /* Set up interrupt trigger */
370 reg
= d
->virt_base
+ EINTCON_REG(bank
->eint_offset
);
371 shift
= EINT_OFFS(bank
->eint_offset
) + irqd
->hwirq
;
372 shift
= 4 * (shift
/ 4); /* 4 EINTs per trigger selector */
375 val
&= ~(EINT_CON_MASK
<< shift
);
376 val
|= trigger
<< shift
;
379 s3c64xx_irq_set_function(d
, bank
, irqd
->hwirq
);
385 * irq_chip for gpio interrupts.
387 static struct irq_chip s3c64xx_gpio_irq_chip
= {
389 .irq_unmask
= s3c64xx_gpio_irq_unmask
,
390 .irq_mask
= s3c64xx_gpio_irq_mask
,
391 .irq_ack
= s3c64xx_gpio_irq_ack
,
392 .irq_set_type
= s3c64xx_gpio_irq_set_type
,
395 static int s3c64xx_gpio_irq_map(struct irq_domain
*h
, unsigned int virq
,
398 struct samsung_pin_bank
*bank
= h
->host_data
;
400 if (!(bank
->eint_mask
& (1 << hw
)))
403 irq_set_chip_and_handler(virq
,
404 &s3c64xx_gpio_irq_chip
, handle_level_irq
);
405 irq_set_chip_data(virq
, bank
);
411 * irq domain callbacks for external gpio interrupt controller.
413 static const struct irq_domain_ops s3c64xx_gpio_irqd_ops
= {
414 .map
= s3c64xx_gpio_irq_map
,
415 .xlate
= irq_domain_xlate_twocell
,
418 static void s3c64xx_eint_gpio_irq(struct irq_desc
*desc
)
420 struct irq_chip
*chip
= irq_desc_get_chip(desc
);
421 struct s3c64xx_eint_gpio_data
*data
= irq_desc_get_handler_data(desc
);
422 struct samsung_pinctrl_drv_data
*drvdata
= data
->drvdata
;
424 chained_irq_enter(chip
, desc
);
432 svc
= readl(drvdata
->virt_base
+ SERVICE_REG
);
433 group
= SVC_GROUP(svc
);
434 pin
= svc
& SVC_NUM_MASK
;
439 /* Group 1 is used for two pin banks */
447 ret
= generic_handle_domain_irq(data
->domains
[group
], pin
);
449 * Something must be really wrong if an unmapped EINT
455 chained_irq_exit(chip
, desc
);
459 * s3c64xx_eint_gpio_init() - setup handling of external gpio interrupts.
460 * @d: driver data of samsung pinctrl driver.
462 static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data
*d
)
464 struct s3c64xx_eint_gpio_data
*data
;
465 struct samsung_pin_bank
*bank
;
466 struct device
*dev
= d
->dev
;
467 unsigned int nr_domains
;
471 dev_err(dev
, "irq number not available\n");
477 for (i
= 0; i
< d
->nr_banks
; ++i
, ++bank
) {
478 unsigned int nr_eints
;
481 if (bank
->eint_type
!= EINT_TYPE_GPIO
)
484 mask
= bank
->eint_mask
;
485 nr_eints
= fls(mask
);
487 bank
->irq_domain
= irq_domain_create_linear(bank
->fwnode
,
488 nr_eints
, &s3c64xx_gpio_irqd_ops
, bank
);
489 if (!bank
->irq_domain
) {
490 dev_err(dev
, "gpio irq domain add failed\n");
497 data
= devm_kzalloc(dev
, struct_size(data
, domains
, nr_domains
),
505 for (i
= 0; i
< d
->nr_banks
; ++i
, ++bank
) {
506 if (bank
->eint_type
!= EINT_TYPE_GPIO
)
509 data
->domains
[nr_domains
++] = bank
->irq_domain
;
512 irq_set_chained_handler_and_data(d
->irq
, s3c64xx_eint_gpio_irq
, data
);
518 * Functions for configuration of EINT0 wake-up interrupts
521 static inline void s3c64xx_eint0_irq_set_mask(struct irq_data
*irqd
, bool mask
)
523 struct s3c64xx_eint0_domain_data
*ddata
=
524 irq_data_get_irq_chip_data(irqd
);
525 struct samsung_pinctrl_drv_data
*d
= ddata
->bank
->drvdata
;
528 val
= readl(d
->virt_base
+ EINT0MASK_REG
);
530 val
|= 1 << ddata
->eints
[irqd
->hwirq
];
532 val
&= ~(1 << ddata
->eints
[irqd
->hwirq
]);
533 writel(val
, d
->virt_base
+ EINT0MASK_REG
);
536 static void s3c64xx_eint0_irq_unmask(struct irq_data
*irqd
)
538 s3c64xx_eint0_irq_set_mask(irqd
, false);
541 static void s3c64xx_eint0_irq_mask(struct irq_data
*irqd
)
543 s3c64xx_eint0_irq_set_mask(irqd
, true);
546 static void s3c64xx_eint0_irq_ack(struct irq_data
*irqd
)
548 struct s3c64xx_eint0_domain_data
*ddata
=
549 irq_data_get_irq_chip_data(irqd
);
550 struct samsung_pinctrl_drv_data
*d
= ddata
->bank
->drvdata
;
552 writel(1 << ddata
->eints
[irqd
->hwirq
],
553 d
->virt_base
+ EINT0PEND_REG
);
556 static int s3c64xx_eint0_irq_set_type(struct irq_data
*irqd
, unsigned int type
)
558 struct s3c64xx_eint0_domain_data
*ddata
=
559 irq_data_get_irq_chip_data(irqd
);
560 struct samsung_pin_bank
*bank
= ddata
->bank
;
561 struct samsung_pinctrl_drv_data
*d
= bank
->drvdata
;
567 trigger
= s3c64xx_irq_get_trigger(type
);
569 pr_err("unsupported external interrupt type\n");
573 s3c64xx_irq_set_handler(irqd
, type
);
575 /* Set up interrupt trigger */
576 reg
= d
->virt_base
+ EINT0CON0_REG
;
577 shift
= ddata
->eints
[irqd
->hwirq
];
578 if (shift
>= EINT_MAX_PER_REG
) {
580 shift
-= EINT_MAX_PER_REG
;
582 shift
= EINT_CON_LEN
* (shift
/ 2);
585 val
&= ~(EINT_CON_MASK
<< shift
);
586 val
|= trigger
<< shift
;
589 s3c64xx_irq_set_function(d
, bank
, irqd
->hwirq
);
595 * irq_chip for wakeup interrupts
597 static struct irq_chip s3c64xx_eint0_irq_chip
= {
599 .irq_unmask
= s3c64xx_eint0_irq_unmask
,
600 .irq_mask
= s3c64xx_eint0_irq_mask
,
601 .irq_ack
= s3c64xx_eint0_irq_ack
,
602 .irq_set_type
= s3c64xx_eint0_irq_set_type
,
605 static inline void s3c64xx_irq_demux_eint(struct irq_desc
*desc
, u32 range
)
607 struct irq_chip
*chip
= irq_desc_get_chip(desc
);
608 struct s3c64xx_eint0_data
*data
= irq_desc_get_handler_data(desc
);
609 struct samsung_pinctrl_drv_data
*drvdata
= data
->drvdata
;
610 unsigned int pend
, mask
;
612 chained_irq_enter(chip
, desc
);
614 pend
= readl(drvdata
->virt_base
+ EINT0PEND_REG
);
615 mask
= readl(drvdata
->virt_base
+ EINT0MASK_REG
);
617 pend
= pend
& range
& ~mask
;
626 ret
= generic_handle_domain_irq(data
->domains
[irq
], data
->pins
[irq
]);
628 * Something must be really wrong if an unmapped EINT
634 chained_irq_exit(chip
, desc
);
637 static void s3c64xx_demux_eint0_3(struct irq_desc
*desc
)
639 s3c64xx_irq_demux_eint(desc
, 0xf);
642 static void s3c64xx_demux_eint4_11(struct irq_desc
*desc
)
644 s3c64xx_irq_demux_eint(desc
, 0xff0);
647 static void s3c64xx_demux_eint12_19(struct irq_desc
*desc
)
649 s3c64xx_irq_demux_eint(desc
, 0xff000);
652 static void s3c64xx_demux_eint20_27(struct irq_desc
*desc
)
654 s3c64xx_irq_demux_eint(desc
, 0xff00000);
657 static irq_flow_handler_t s3c64xx_eint0_handlers
[NUM_EINT0_IRQ
] = {
658 s3c64xx_demux_eint0_3
,
659 s3c64xx_demux_eint4_11
,
660 s3c64xx_demux_eint12_19
,
661 s3c64xx_demux_eint20_27
,
664 static int s3c64xx_eint0_irq_map(struct irq_domain
*h
, unsigned int virq
,
667 struct s3c64xx_eint0_domain_data
*ddata
= h
->host_data
;
668 struct samsung_pin_bank
*bank
= ddata
->bank
;
670 if (!(bank
->eint_mask
& (1 << hw
)))
673 irq_set_chip_and_handler(virq
,
674 &s3c64xx_eint0_irq_chip
, handle_level_irq
);
675 irq_set_chip_data(virq
, ddata
);
681 * irq domain callbacks for external wakeup interrupt controller.
683 static const struct irq_domain_ops s3c64xx_eint0_irqd_ops
= {
684 .map
= s3c64xx_eint0_irq_map
,
685 .xlate
= irq_domain_xlate_twocell
,
688 /* list of external wakeup controllers supported */
689 static const struct of_device_id s3c64xx_eint0_irq_ids
[] = {
690 { .compatible
= "samsung,s3c64xx-wakeup-eint", },
695 * s3c64xx_eint_eint0_init() - setup handling of external wakeup interrupts.
696 * @d: driver data of samsung pinctrl driver.
698 static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data
*d
)
700 struct device
*dev
= d
->dev
;
701 struct device_node
*eint0_np
= NULL
;
702 struct device_node
*np
;
703 struct samsung_pin_bank
*bank
;
704 struct s3c64xx_eint0_data
*data
;
707 for_each_child_of_node(dev
->of_node
, np
) {
708 if (of_match_node(s3c64xx_eint0_irq_ids
, np
)) {
716 data
= devm_kzalloc(dev
, sizeof(*data
), GFP_KERNEL
);
718 of_node_put(eint0_np
);
723 for (i
= 0; i
< NUM_EINT0_IRQ
; ++i
) {
726 irq
= irq_of_parse_and_map(eint0_np
, i
);
728 dev_err(dev
, "failed to get wakeup EINT IRQ %d\n", i
);
729 of_node_put(eint0_np
);
733 irq_set_chained_handler_and_data(irq
,
734 s3c64xx_eint0_handlers
[i
],
737 of_node_put(eint0_np
);
740 for (i
= 0; i
< d
->nr_banks
; ++i
, ++bank
) {
741 struct s3c64xx_eint0_domain_data
*ddata
;
742 unsigned int nr_eints
;
747 if (bank
->eint_type
!= EINT_TYPE_WKUP
)
750 mask
= bank
->eint_mask
;
751 nr_eints
= fls(mask
);
753 ddata
= devm_kzalloc(dev
,
754 sizeof(*ddata
) + nr_eints
, GFP_KERNEL
);
759 bank
->irq_domain
= irq_domain_create_linear(bank
->fwnode
,
760 nr_eints
, &s3c64xx_eint0_irqd_ops
, ddata
);
761 if (!bank
->irq_domain
) {
762 dev_err(dev
, "wkup irq domain add failed\n");
766 irq
= bank
->eint_offset
;
767 mask
= bank
->eint_mask
;
768 for (pin
= 0; mask
; ++pin
, mask
>>= 1) {
771 data
->domains
[irq
] = bank
->irq_domain
;
772 data
->pins
[irq
] = pin
;
773 ddata
->eints
[pin
] = irq
;
781 /* pin banks of s3c64xx pin-controller 0 */
782 static const struct samsung_pin_bank_data s3c64xx_pin_banks0
[] __initconst
= {
783 PIN_BANK_4BIT_EINTG(8, 0x000, "gpa", 0),
784 PIN_BANK_4BIT_EINTG(7, 0x020, "gpb", 8),
785 PIN_BANK_4BIT_EINTG(8, 0x040, "gpc", 16),
786 PIN_BANK_4BIT_EINTG(5, 0x060, "gpd", 32),
787 PIN_BANK_4BIT(5, 0x080, "gpe"),
788 PIN_BANK_2BIT_EINTG(16, 0x0a0, "gpf", 48, 0x3fff),
789 PIN_BANK_4BIT_EINTG(7, 0x0c0, "gpg", 64),
790 PIN_BANK_4BIT2_EINTG(10, 0x0e0, "gph", 80),
791 PIN_BANK_2BIT(16, 0x100, "gpi"),
792 PIN_BANK_2BIT(12, 0x120, "gpj"),
793 PIN_BANK_4BIT2_ALIVE(16, 0x800, "gpk"),
794 PIN_BANK_4BIT2_EINTW(15, 0x810, "gpl", 16, 0x7f00),
795 PIN_BANK_4BIT_EINTW(6, 0x820, "gpm", 23, 0x1f),
796 PIN_BANK_2BIT_EINTW(16, 0x830, "gpn", 0),
797 PIN_BANK_2BIT_EINTG(16, 0x140, "gpo", 96, 0xffff),
798 PIN_BANK_2BIT_EINTG(15, 0x160, "gpp", 112, 0x7fff),
799 PIN_BANK_2BIT_EINTG(9, 0x180, "gpq", 128, 0x1ff),
803 * Samsung pinctrl driver data for S3C64xx SoC. S3C64xx SoC includes
804 * one gpio/pin-mux/pinconfig controller.
806 static const struct samsung_pin_ctrl s3c64xx_pin_ctrl
[] __initconst
= {
808 /* pin-controller instance 1 data */
809 .pin_banks
= s3c64xx_pin_banks0
,
810 .nr_banks
= ARRAY_SIZE(s3c64xx_pin_banks0
),
811 .eint_gpio_init
= s3c64xx_eint_gpio_init
,
812 .eint_wkup_init
= s3c64xx_eint_eint0_init
,
813 .pud_value_init
= s3c64xx_pud_value_init
,
817 const struct samsung_pinctrl_of_match_data s3c64xx_of_data __initconst
= {
818 .ctrl
= s3c64xx_pin_ctrl
,
819 .num_ctrl
= ARRAY_SIZE(s3c64xx_pin_ctrl
),