Skip to content

Commit 9dd4819

Browse files
Russell Kinglinusw
authored andcommitted
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: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 7477e13 commit 9dd4819

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

drivers/gpio/gpio-sa1100.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/module.h>
1313
#include <linux/io.h>
1414
#include <linux/syscore_ops.h>
15+
#include <soc/sa1100/pwer.h>
1516
#include <mach/hardware.h>
1617
#include <mach/irqs.h>
1718

@@ -73,6 +74,7 @@ static struct gpio_chip sa1100_gpio_chip = {
7374
static int GPIO_IRQ_rising_edge;
7475
static int GPIO_IRQ_falling_edge;
7576
static int GPIO_IRQ_mask;
77+
static int GPIO_IRQ_wake;
7678

7779
static int sa1100_gpio_type(struct irq_data *d, unsigned int type)
7880
{
@@ -131,11 +133,14 @@ static void sa1100_gpio_unmask(struct irq_data *d)
131133

132134
static int sa1100_gpio_wake(struct irq_data *d, unsigned int on)
133135
{
134-
if (on)
135-
PWER |= BIT(d->hwirq);
136-
else
137-
PWER &= ~BIT(d->hwirq);
138-
return 0;
136+
int ret = sa11x0_gpio_set_wake(d->hwirq, on);
137+
if (!ret) {
138+
if (on)
139+
GPIO_IRQ_wake |= BIT(d->hwirq);
140+
else
141+
GPIO_IRQ_wake &= ~BIT(d->hwirq);
142+
}
143+
return ret;
139144
}
140145

141146
/*
@@ -201,8 +206,8 @@ static int sa1100_gpio_suspend(void)
201206
/*
202207
* Set the appropriate edges for wakeup.
203208
*/
204-
GRER = PWER & GPIO_IRQ_rising_edge;
205-
GFER = PWER & GPIO_IRQ_falling_edge;
209+
GRER = GPIO_IRQ_wake & GPIO_IRQ_rising_edge;
210+
GFER = GPIO_IRQ_wake & GPIO_IRQ_falling_edge;
206211

207212
/*
208213
* Clear any pending GPIO interrupts.

0 commit comments

Comments
 (0)