diff options
Diffstat (limited to 'arch/arm/mach-tegra/wakeups-t2.c')
-rw-r--r-- | arch/arm/mach-tegra/wakeups-t2.c | 57 |
1 files changed, 4 insertions, 53 deletions
diff --git a/arch/arm/mach-tegra/wakeups-t2.c b/arch/arm/mach-tegra/wakeups-t2.c index 7c5d12ac60d4..8079e6820145 100644 --- a/arch/arm/mach-tegra/wakeups-t2.c +++ b/arch/arm/mach-tegra/wakeups-t2.c @@ -22,8 +22,9 @@ #include <mach/gpio.h> #include "gpio-names.h" +#include "wakeups.h" -static int tegra_wake_event_irq[] = { +static int tegra_wake_event_irq_t2[] = { [0] = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PO5), [1] = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV3), [2] = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PL1), @@ -57,55 +58,5 @@ static int tegra_wake_event_irq[] = { [30] = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PN2), }; -int tegra_irq_to_wake(int irq) -{ - int i; - int wake_irq; - int search_gpio; - static int last_wake = -1; - - /* Two level wake irq search for gpio based wakeups - - * 1. check for GPIO irq(based on tegra_wake_event_irq table) - * e.g. for a board, wake7 based on GPIO PU6 and irq==358 done first - * 2. check for gpio bank irq assuming search for GPIO irq - * preceded this search. - * e.g. in this step check for gpio bank irq GPIO6 irq==119 - */ - for (i = 0; i < ARRAY_SIZE(tegra_wake_event_irq); i++) { - /* return if step 1 matches */ - if (tegra_wake_event_irq[i] == irq) { - pr_info("Wake%d for irq=%d\n", i, irq); - last_wake = i; - return i; - } - - /* step 2 below uses saved last_wake from step 1 - * in previous call */ - search_gpio = irq_to_gpio( - tegra_wake_event_irq[i]); - if (search_gpio < 0) - continue; - wake_irq = tegra_gpio_get_bank_int_nr(search_gpio); - if (wake_irq < 0) - continue; - if ((last_wake == i) && - (wake_irq == irq)) { - pr_info("gpio bank wake found: wake%d for irq=%d\n", - i, irq); - return i; - } - } - - return -EINVAL; -} - -int tegra_wake_to_irq(int wake) -{ - if (wake < 0) - return -EINVAL; - - if (wake >= ARRAY_SIZE(tegra_wake_event_irq)) - return -EINVAL; - - return tegra_wake_event_irq[wake]; -} +int *tegra_wake_event_irq = tegra_wake_event_irq_t2; +unsigned int tegra_wake_event_irq_size = ARRAY_SIZE(tegra_wake_event_irq_t2); |