|
12 | 12 | #include <linux/module.h>
|
13 | 13 | #include <linux/io.h>
|
14 | 14 | #include <linux/syscore_ops.h>
|
| 15 | +#include <soc/sa1100/pwer.h> |
15 | 16 | #include <mach/hardware.h>
|
16 | 17 | #include <mach/irqs.h>
|
17 | 18 |
|
@@ -73,6 +74,7 @@ static struct gpio_chip sa1100_gpio_chip = {
|
73 | 74 | static int GPIO_IRQ_rising_edge;
|
74 | 75 | static int GPIO_IRQ_falling_edge;
|
75 | 76 | static int GPIO_IRQ_mask;
|
| 77 | +static int GPIO_IRQ_wake; |
76 | 78 |
|
77 | 79 | static int sa1100_gpio_type(struct irq_data *d, unsigned int type)
|
78 | 80 | {
|
@@ -131,11 +133,14 @@ static void sa1100_gpio_unmask(struct irq_data *d)
|
131 | 133 |
|
132 | 134 | static int sa1100_gpio_wake(struct irq_data *d, unsigned int on)
|
133 | 135 | {
|
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; |
139 | 144 | }
|
140 | 145 |
|
141 | 146 | /*
|
@@ -201,8 +206,8 @@ static int sa1100_gpio_suspend(void)
|
201 | 206 | /*
|
202 | 207 | * Set the appropriate edges for wakeup.
|
203 | 208 | */
|
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; |
206 | 211 |
|
207 | 212 | /*
|
208 | 213 | * Clear any pending GPIO interrupts.
|
|
0 commit comments