Commit 9dd4819e authored by Russell King's avatar Russell King Committed by Linus Walleij

gpio: sa1100: use sa11x0_gpio_set_wake()

Use sa11x0_gpio_set_wake() to set the PWER register, as provided by
Dmitry some time back.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7477e137
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/syscore_ops.h> #include <linux/syscore_ops.h>
#include <soc/sa1100/pwer.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
...@@ -73,6 +74,7 @@ static struct gpio_chip sa1100_gpio_chip = { ...@@ -73,6 +74,7 @@ static struct gpio_chip sa1100_gpio_chip = {
static int GPIO_IRQ_rising_edge; static int GPIO_IRQ_rising_edge;
static int GPIO_IRQ_falling_edge; static int GPIO_IRQ_falling_edge;
static int GPIO_IRQ_mask; static int GPIO_IRQ_mask;
static int GPIO_IRQ_wake;
static int sa1100_gpio_type(struct irq_data *d, unsigned int type) static int sa1100_gpio_type(struct irq_data *d, unsigned int type)
{ {
...@@ -131,11 +133,14 @@ static void sa1100_gpio_unmask(struct irq_data *d) ...@@ -131,11 +133,14 @@ static void sa1100_gpio_unmask(struct irq_data *d)
static int sa1100_gpio_wake(struct irq_data *d, unsigned int on) static int sa1100_gpio_wake(struct irq_data *d, unsigned int on)
{ {
if (on) int ret = sa11x0_gpio_set_wake(d->hwirq, on);
PWER |= BIT(d->hwirq); if (!ret) {
else if (on)
PWER &= ~BIT(d->hwirq); GPIO_IRQ_wake |= BIT(d->hwirq);
return 0; else
GPIO_IRQ_wake &= ~BIT(d->hwirq);
}
return ret;
} }
/* /*
...@@ -201,8 +206,8 @@ static int sa1100_gpio_suspend(void) ...@@ -201,8 +206,8 @@ static int sa1100_gpio_suspend(void)
/* /*
* Set the appropriate edges for wakeup. * Set the appropriate edges for wakeup.
*/ */
GRER = PWER & GPIO_IRQ_rising_edge; GRER = GPIO_IRQ_wake & GPIO_IRQ_rising_edge;
GFER = PWER & GPIO_IRQ_falling_edge; GFER = GPIO_IRQ_wake & GPIO_IRQ_falling_edge;
/* /*
* Clear any pending GPIO interrupts. * Clear any pending GPIO interrupts.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment