diff options
author | Tomasz Figa <t.figa@samsung.com> | 2013-05-17 12:24:27 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-05-27 09:37:08 -0400 |
commit | ad350cd9d5411353397843c8f410a6e7e84a71f9 (patch) | |
tree | a92df94dd7659ec005f9cca5c75265b0f29cbb69 | |
parent | d9f998639f539613bb25cbbca380c81c892d586c (diff) |
pinctrl: exynos: Add support for set_irq_wake of wake-up EINTs
This patch adds support of IRQ wake-up ability configuration for
wake-up EINTs on Exynos SoCs.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-exynos.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index ac742817ebce..4f868e59227e 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c | |||
@@ -326,6 +326,28 @@ static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type) | |||
326 | return 0; | 326 | return 0; |
327 | } | 327 | } |
328 | 328 | ||
329 | static u32 exynos_eint_wake_mask = 0xffffffff; | ||
330 | |||
331 | u32 exynos_get_eint_wake_mask(void) | ||
332 | { | ||
333 | return exynos_eint_wake_mask; | ||
334 | } | ||
335 | |||
336 | static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) | ||
337 | { | ||
338 | struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); | ||
339 | unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq); | ||
340 | |||
341 | pr_info("wake %s for irq %d\n", on ? "enabled" : "disabled", irqd->irq); | ||
342 | |||
343 | if (!on) | ||
344 | exynos_eint_wake_mask |= bit; | ||
345 | else | ||
346 | exynos_eint_wake_mask &= ~bit; | ||
347 | |||
348 | return 0; | ||
349 | } | ||
350 | |||
329 | /* | 351 | /* |
330 | * irq_chip for wakeup interrupts | 352 | * irq_chip for wakeup interrupts |
331 | */ | 353 | */ |
@@ -335,6 +357,7 @@ static struct irq_chip exynos_wkup_irq_chip = { | |||
335 | .irq_mask = exynos_wkup_irq_mask, | 357 | .irq_mask = exynos_wkup_irq_mask, |
336 | .irq_ack = exynos_wkup_irq_ack, | 358 | .irq_ack = exynos_wkup_irq_ack, |
337 | .irq_set_type = exynos_wkup_irq_set_type, | 359 | .irq_set_type = exynos_wkup_irq_set_type, |
360 | .irq_set_wake = exynos_wkup_irq_set_wake, | ||
338 | }; | 361 | }; |
339 | 362 | ||
340 | /* interrupt handler for wakeup interrupts 0..15 */ | 363 | /* interrupt handler for wakeup interrupts 0..15 */ |