diff options
author | Bitan Biswas <bbiswas@nvidia.com> | 2013-05-19 03:14:41 +0530 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2013-06-11 11:17:12 -0700 |
commit | b96d7c7db56bb49cd4f81190e25cf55b58794ab7 (patch) | |
tree | 27dc5680b51e542032e29bc2e877b9a19583cbc4 /arch/arm/mach-tegra/wakeups-t11x.c | |
parent | e08e02857171adc7579c958962a33a97de0ec6e8 (diff) |
ARM: tegra: allow 1-to-many irq to wake mapping
Problem:
Current Tegra wake table does not allow same USB irq to be used
for multiple wake sources.
Fix:
Changed tegra_irq_to_wake API to return multiple wake table indices
bug 1275273
Change-Id: I72e6d83cb71de76e23ea9623b6fcae34091171bb
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: http://git-master/r/231921
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/wakeups-t11x.c')
-rw-r--r-- | arch/arm/mach-tegra/wakeups-t11x.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/wakeups-t11x.c b/arch/arm/mach-tegra/wakeups-t11x.c index 43a0bdf150ab..7a1834f63245 100644 --- a/arch/arm/mach-tegra/wakeups-t11x.c +++ b/arch/arm/mach-tegra/wakeups-t11x.c @@ -233,18 +233,20 @@ void tegra_set_usb_wake_source(void) } } -int tegra_irq_to_wake(int irq) +void tegra_irq_to_wake(int irq, int *wak_list, int *wak_size) { int i; - int ret = -EINVAL; + *wak_size = 0; for (i = 0; i < ARRAY_SIZE(tegra_wake_event_irq); i++) { if (tegra_wake_event_irq[i] == irq) { pr_info("Wake%d for irq=%d\n", i, irq); - ret = i; - goto out; + wak_list[*wak_size] = i; + *wak_size = *wak_size + 1; } } + if (*wak_size) + goto out; /* The gpio set_wake code bubbles the set_wake call up to the irq * set_wake code. This insures that the nested irq set_wake call @@ -259,11 +261,12 @@ int tegra_irq_to_wake(int irq) if (tegra_gpio_get_bank_int_nr(tegra_gpio_wakes[last_gpio]) == irq) { pr_info("gpio bank wake found: wake%d for irq=%d\n", i, irq); - ret = last_gpio; + wak_list[*wak_size] = last_gpio; + *wak_size = 1; } out: - return ret; + return; } int tegra_wake_to_irq(int wake) |