[ARM] tegra: gpio: Add support for waking from suspend
authorColin Cross <ccross@google.com>
Wed, 18 Aug 2010 07:19:27 +0000 (00:19 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:26:27 +0000 (16:26 -0700)
Change-Id: If692ff0e7de3d3d5a825a8b1e7989650ef9fb238
Signed-off-by: Colin Cross <ccross@google.com>
arch/arm/mach-tegra/gpio.c

index 1bf92e581cc6f43ffbc25e15c4a97aff0297bddd..0187aaa61cd9b3c80ff5c141fc52b1f454a8aea8 100644 (file)
@@ -212,6 +212,9 @@ static int tegra_gpio_irq_set_type(unsigned int irq, unsigned int type)
        else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
                __set_irq_handler_unlocked(irq, handle_edge_irq);
 
+       if (tegra_get_suspend_mode() == TEGRA_SUSPEND_LP0)
+               tegra_set_lp0_wake_type(irq, type);
+
        return 0;
 }
 
@@ -319,8 +322,17 @@ void tegra_gpio_suspend(void)
 
 static int tegra_gpio_wake_enable(unsigned int irq, unsigned int enable)
 {
+       int ret;
        struct tegra_gpio_bank *bank = get_irq_chip_data(irq);
-       return set_irq_wake(bank->irq, enable);
+
+       ret = tegra_set_lp1_wake(bank->irq, enable);
+       if (ret)
+               return ret;
+
+       if (tegra_get_suspend_mode() == TEGRA_SUSPEND_LP0)
+               return tegra_set_lp0_wake(irq, enable);
+
+       return 0;
 }
 #endif