diff options
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 87ade40865f1..b230af22ae05 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/arch/irqs.h> | 23 | #include <asm/arch/irqs.h> |
24 | #include <asm/arch/pxa-regs.h> | 24 | #include <asm/arch/pxa-regs.h> |
25 | #include <asm/arch/pxa2xx-regs.h> | 25 | #include <asm/arch/pxa2xx-regs.h> |
26 | #include <asm/arch/mfp-pxa27x.h> | ||
26 | #include <asm/arch/ohci.h> | 27 | #include <asm/arch/ohci.h> |
27 | #include <asm/arch/pm.h> | 28 | #include <asm/arch/pm.h> |
28 | #include <asm/arch/dma.h> | 29 | #include <asm/arch/dma.h> |
@@ -286,37 +287,16 @@ static inline void pxa27x_init_pm(void) {} | |||
286 | /* PXA27x: Various gpios can issue wakeup events. This logic only | 287 | /* PXA27x: Various gpios can issue wakeup events. This logic only |
287 | * handles the simple cases, not the WEMUX2 and WEMUX3 options | 288 | * handles the simple cases, not the WEMUX2 and WEMUX3 options |
288 | */ | 289 | */ |
289 | #define PXA27x_GPIO_NOWAKE_MASK \ | ||
290 | ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2)) | ||
291 | #define WAKEMASK(gpio) \ | ||
292 | (((gpio) <= 15) \ | ||
293 | ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \ | ||
294 | : ((gpio == 35) ? (1 << 24) : 0)) | ||
295 | |||
296 | static int pxa27x_set_wake(unsigned int irq, unsigned int on) | 290 | static int pxa27x_set_wake(unsigned int irq, unsigned int on) |
297 | { | 291 | { |
298 | int gpio = IRQ_TO_GPIO(irq); | 292 | int gpio = IRQ_TO_GPIO(irq); |
299 | uint32_t mask; | 293 | uint32_t mask; |
300 | 294 | ||
301 | if ((gpio >= 0 && gpio <= 15) || (gpio == 35)) { | 295 | if (gpio >= 0 && gpio < 128) |
302 | if (WAKEMASK(gpio) == 0) | 296 | return gpio_set_wake(gpio, on); |
303 | return -EINVAL; | ||
304 | |||
305 | mask = WAKEMASK(gpio); | ||
306 | |||
307 | if (on) { | ||
308 | if (GRER(gpio) | GPIO_bit(gpio)) | ||
309 | PRER |= mask; | ||
310 | else | ||
311 | PRER &= ~mask; | ||
312 | 297 | ||
313 | if (GFER(gpio) | GPIO_bit(gpio)) | 298 | if (irq == IRQ_KEYPAD) |
314 | PFER |= mask; | 299 | return keypad_set_wake(on); |
315 | else | ||
316 | PFER &= ~mask; | ||
317 | } | ||
318 | goto set_pwer; | ||
319 | } | ||
320 | 300 | ||
321 | switch (irq) { | 301 | switch (irq) { |
322 | case IRQ_RTCAlrm: | 302 | case IRQ_RTCAlrm: |
@@ -329,7 +309,6 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on) | |||
329 | return -EINVAL; | 309 | return -EINVAL; |
330 | } | 310 | } |
331 | 311 | ||
332 | set_pwer: | ||
333 | if (on) | 312 | if (on) |
334 | PWER |= mask; | 313 | PWER |= mask; |
335 | else | 314 | else |