summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-03-28 17:47:31 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:34:17 -0800
commit45a1ca04697006a2358ceed51e93728f17f260bf (patch)
treea13d1ca7165518e1b81e4a5645e4fc3adeffa45f /drivers/gpio
parent7f44234fa7b98401d71943e3e33cb09e02d6f672 (diff)
ARM: tegra: gpio: Convert suspend/resume to syscore
Signed-off-by: Colin Cross <ccross@android.com> Change-Id: I5cd5b83eb0a760826fc7443f06cd1e94bba359db
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-tegra.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index abc0ceeadac3..f287f9c7a75e 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -24,6 +24,7 @@
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/of.h>
+#include <linux/syscore_ops.h>
#include <asm/mach/irq.h>
@@ -261,7 +262,7 @@ static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
}
#ifdef CONFIG_PM
-void tegra_gpio_resume(void)
+static void tegra_gpio_resume(void)
{
unsigned long flags;
int b;
@@ -285,7 +286,7 @@ void tegra_gpio_resume(void)
local_irq_restore(flags);
}
-void tegra_gpio_suspend(void)
+static int tegra_gpio_suspend(void)
{
unsigned long flags;
int b;
@@ -305,6 +306,8 @@ void tegra_gpio_suspend(void)
}
}
local_irq_restore(flags);
+
+ return 0;
}
static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
@@ -326,8 +329,22 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
}
#else
#define tegra_gpio_irq_set_wake NULL
+#define tegra_gpio_suspend NULL
+#define tegra_gpio_resume NULL
#endif
+static struct syscore_ops tegra_gpio_syscore_ops = {
+ .suspend = tegra_gpio_suspend,
+ .resume = tegra_gpio_resume,
+};
+
+int tegra_gpio_resume_init(void)
+{
+ register_syscore_ops(&tegra_gpio_syscore_ops);
+
+ return 0;
+}
+
static struct irq_chip tegra_gpio_irq_chip = {
.name = "GPIO",
.irq_ack = tegra_gpio_irq_ack,