diff options
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt | 2 | ||||
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-exynos.c | 45 | ||||
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-exynos.h | 3 |
3 files changed, 40 insertions, 10 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index e82aaf492517..f80519a98df8 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt | |||
@@ -136,6 +136,8 @@ B. External Wakeup Interrupts: For supporting external wakeup interrupts, a | |||
136 | found on Samsung S3C64xx SoCs, | 136 | found on Samsung S3C64xx SoCs, |
137 | - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller | 137 | - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller |
138 | found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs. | 138 | found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs. |
139 | - samsung,exynos7-wakeup-eint: represents wakeup interrupt controller | ||
140 | found on Samsung Exynos7 SoC. | ||
139 | - interrupt-parent: phandle of the interrupt parent to which the external | 141 | - interrupt-parent: phandle of the interrupt parent to which the external |
140 | wakeup interrupts are forwarded to. | 142 | wakeup interrupts are forwarded to. |
141 | - interrupts: interrupt used by multiplexed wakeup interrupts. | 143 | - interrupts: interrupt used by multiplexed wakeup interrupts. |
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 7a7eb6a271eb..d97765c20466 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c | |||
@@ -56,12 +56,6 @@ static const struct samsung_pin_bank_type bank_type_alive = { | |||
56 | .reg_offset = { 0x00, 0x04, 0x08, 0x0c, }, | 56 | .reg_offset = { 0x00, 0x04, 0x08, 0x0c, }, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* list of external wakeup controllers supported */ | ||
60 | static const struct of_device_id exynos_wkup_irq_ids[] = { | ||
61 | { .compatible = "samsung,exynos4210-wakeup-eint", }, | ||
62 | { } | ||
63 | }; | ||
64 | |||
65 | static void exynos_irq_mask(struct irq_data *irqd) | 59 | static void exynos_irq_mask(struct irq_data *irqd) |
66 | { | 60 | { |
67 | struct irq_chip *chip = irq_data_get_irq_chip(irqd); | 61 | struct irq_chip *chip = irq_data_get_irq_chip(irqd); |
@@ -384,9 +378,9 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) | |||
384 | /* | 378 | /* |
385 | * irq_chip for wakeup interrupts | 379 | * irq_chip for wakeup interrupts |
386 | */ | 380 | */ |
387 | static struct exynos_irq_chip exynos_wkup_irq_chip = { | 381 | static struct exynos_irq_chip exynos4210_wkup_irq_chip __initdata = { |
388 | .chip = { | 382 | .chip = { |
389 | .name = "exynos_wkup_irq_chip", | 383 | .name = "exynos4210_wkup_irq_chip", |
390 | .irq_unmask = exynos_irq_unmask, | 384 | .irq_unmask = exynos_irq_unmask, |
391 | .irq_mask = exynos_irq_mask, | 385 | .irq_mask = exynos_irq_mask, |
392 | .irq_ack = exynos_irq_ack, | 386 | .irq_ack = exynos_irq_ack, |
@@ -400,6 +394,31 @@ static struct exynos_irq_chip exynos_wkup_irq_chip = { | |||
400 | .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, | 394 | .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, |
401 | }; | 395 | }; |
402 | 396 | ||
397 | static struct exynos_irq_chip exynos7_wkup_irq_chip __initdata = { | ||
398 | .chip = { | ||
399 | .name = "exynos7_wkup_irq_chip", | ||
400 | .irq_unmask = exynos_irq_unmask, | ||
401 | .irq_mask = exynos_irq_mask, | ||
402 | .irq_ack = exynos_irq_ack, | ||
403 | .irq_set_type = exynos_irq_set_type, | ||
404 | .irq_set_wake = exynos_wkup_irq_set_wake, | ||
405 | .irq_request_resources = exynos_irq_request_resources, | ||
406 | .irq_release_resources = exynos_irq_release_resources, | ||
407 | }, | ||
408 | .eint_con = EXYNOS7_WKUP_ECON_OFFSET, | ||
409 | .eint_mask = EXYNOS7_WKUP_EMASK_OFFSET, | ||
410 | .eint_pend = EXYNOS7_WKUP_EPEND_OFFSET, | ||
411 | }; | ||
412 | |||
413 | /* list of external wakeup controllers supported */ | ||
414 | static const struct of_device_id exynos_wkup_irq_ids[] = { | ||
415 | { .compatible = "samsung,exynos4210-wakeup-eint", | ||
416 | .data = &exynos4210_wkup_irq_chip }, | ||
417 | { .compatible = "samsung,exynos7-wakeup-eint", | ||
418 | .data = &exynos7_wkup_irq_chip }, | ||
419 | { } | ||
420 | }; | ||
421 | |||
403 | /* interrupt handler for wakeup interrupts 0..15 */ | 422 | /* interrupt handler for wakeup interrupts 0..15 */ |
404 | static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc) | 423 | static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc) |
405 | { | 424 | { |
@@ -468,12 +487,18 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) | |||
468 | struct samsung_pin_bank *bank; | 487 | struct samsung_pin_bank *bank; |
469 | struct exynos_weint_data *weint_data; | 488 | struct exynos_weint_data *weint_data; |
470 | struct exynos_muxed_weint_data *muxed_data; | 489 | struct exynos_muxed_weint_data *muxed_data; |
490 | struct exynos_irq_chip *irq_chip; | ||
471 | unsigned int muxed_banks = 0; | 491 | unsigned int muxed_banks = 0; |
472 | unsigned int i; | 492 | unsigned int i; |
473 | int idx, irq; | 493 | int idx, irq; |
474 | 494 | ||
475 | for_each_child_of_node(dev->of_node, np) { | 495 | for_each_child_of_node(dev->of_node, np) { |
476 | if (of_match_node(exynos_wkup_irq_ids, np)) { | 496 | const struct of_device_id *match; |
497 | |||
498 | match = of_match_node(exynos_wkup_irq_ids, np); | ||
499 | if (match) { | ||
500 | irq_chip = kmemdup(match->data, | ||
501 | sizeof(*irq_chip), GFP_KERNEL); | ||
477 | wkup_np = np; | 502 | wkup_np = np; |
478 | break; | 503 | break; |
479 | } | 504 | } |
@@ -493,7 +518,7 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) | |||
493 | return -ENXIO; | 518 | return -ENXIO; |
494 | } | 519 | } |
495 | 520 | ||
496 | bank->irq_chip = &exynos_wkup_irq_chip; | 521 | bank->irq_chip = irq_chip; |
497 | 522 | ||
498 | if (!of_find_property(bank->of_node, "interrupts", NULL)) { | 523 | if (!of_find_property(bank->of_node, "interrupts", NULL)) { |
499 | bank->eint_type = EINT_TYPE_WKUP_MUX; | 524 | bank->eint_type = EINT_TYPE_WKUP_MUX; |
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h index 3c91c357792f..0f0f7cedb2dc 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.h +++ b/drivers/pinctrl/samsung/pinctrl-exynos.h | |||
@@ -25,6 +25,9 @@ | |||
25 | #define EXYNOS_WKUP_ECON_OFFSET 0xE00 | 25 | #define EXYNOS_WKUP_ECON_OFFSET 0xE00 |
26 | #define EXYNOS_WKUP_EMASK_OFFSET 0xF00 | 26 | #define EXYNOS_WKUP_EMASK_OFFSET 0xF00 |
27 | #define EXYNOS_WKUP_EPEND_OFFSET 0xF40 | 27 | #define EXYNOS_WKUP_EPEND_OFFSET 0xF40 |
28 | #define EXYNOS7_WKUP_ECON_OFFSET 0x700 | ||
29 | #define EXYNOS7_WKUP_EMASK_OFFSET 0x900 | ||
30 | #define EXYNOS7_WKUP_EPEND_OFFSET 0xA00 | ||
28 | #define EXYNOS_SVC_OFFSET 0xB08 | 31 | #define EXYNOS_SVC_OFFSET 0xB08 |
29 | #define EXYNOS_EINT_FUNC 0xF | 32 | #define EXYNOS_EINT_FUNC 0xF |
30 | 33 | ||