aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pxa27x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r--arch/arm/mach-pxa/pxa27x.c48
1 files changed, 12 insertions, 36 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 46a951c3e5a0..7a2449dd0fd4 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>
@@ -151,12 +152,15 @@ static struct clk pxa27x_clks[] = {
151 152
152 INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev), 153 INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
153 INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev), 154 INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
154 INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL), 155 INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
155 156
156 INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev), 157 INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
157 INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev), 158 INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
158 INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev), 159 INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
159 160
161 INIT_CKEN("AC97CLK", AC97, 24576000, 0, NULL),
162 INIT_CKEN("AC97CONFCLK", AC97CONF, 24576000, 0, NULL),
163
160 /* 164 /*
161 INIT_CKEN("PWMCLK", PWM0, 13000000, 0, NULL), 165 INIT_CKEN("PWMCLK", PWM0, 13000000, 0, NULL),
162 INIT_CKEN("MSLCLK", MSL, 48000000, 0, NULL), 166 INIT_CKEN("MSLCLK", MSL, 48000000, 0, NULL),
@@ -283,37 +287,16 @@ static inline void pxa27x_init_pm(void) {}
283/* PXA27x: Various gpios can issue wakeup events. This logic only 287/* PXA27x: Various gpios can issue wakeup events. This logic only
284 * handles the simple cases, not the WEMUX2 and WEMUX3 options 288 * handles the simple cases, not the WEMUX2 and WEMUX3 options
285 */ 289 */
286#define PXA27x_GPIO_NOWAKE_MASK \
287 ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2))
288#define WAKEMASK(gpio) \
289 (((gpio) <= 15) \
290 ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \
291 : ((gpio == 35) ? (1 << 24) : 0))
292
293static int pxa27x_set_wake(unsigned int irq, unsigned int on) 290static int pxa27x_set_wake(unsigned int irq, unsigned int on)
294{ 291{
295 int gpio = IRQ_TO_GPIO(irq); 292 int gpio = IRQ_TO_GPIO(irq);
296 uint32_t mask; 293 uint32_t mask;
297 294
298 if ((gpio >= 0 && gpio <= 15) || (gpio == 35)) { 295 if (gpio >= 0 && gpio < 128)
299 if (WAKEMASK(gpio) == 0) 296 return gpio_set_wake(gpio, on);
300 return -EINVAL;
301
302 mask = WAKEMASK(gpio);
303
304 if (on) {
305 if (GRER(gpio) | GPIO_bit(gpio))
306 PRER |= mask;
307 else
308 PRER &= ~mask;
309 297
310 if (GFER(gpio) | GPIO_bit(gpio)) 298 if (irq == IRQ_KEYPAD)
311 PFER |= mask; 299 return keypad_set_wake(on);
312 else
313 PFER &= ~mask;
314 }
315 goto set_pwer;
316 }
317 300
318 switch (irq) { 301 switch (irq) {
319 case IRQ_RTCAlrm: 302 case IRQ_RTCAlrm:
@@ -326,7 +309,6 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)
326 return -EINVAL; 309 return -EINVAL;
327 } 310 }
328 311
329set_pwer:
330 if (on) 312 if (on)
331 PWER |= mask; 313 PWER |= mask;
332 else 314 else
@@ -337,10 +319,8 @@ set_pwer:
337 319
338void __init pxa27x_init_irq(void) 320void __init pxa27x_init_irq(void)
339{ 321{
340 pxa_init_irq_low(); 322 pxa_init_irq(34, pxa27x_set_wake);
341 pxa_init_irq_high(); 323 pxa_init_gpio(128, pxa27x_set_wake);
342 pxa_init_irq_gpio(128);
343 pxa_init_irq_set_wake(pxa27x_set_wake);
344} 324}
345 325
346/* 326/*
@@ -386,10 +366,6 @@ static struct platform_device *devices[] __initdata = {
386 366
387static struct sys_device pxa27x_sysdev[] = { 367static struct sys_device pxa27x_sysdev[] = {
388 { 368 {
389 .id = 0,
390 .cls = &pxa_irq_sysclass,
391 }, {
392 .id = 1,
393 .cls = &pxa_irq_sysclass, 369 .cls = &pxa_irq_sysclass,
394 }, { 370 }, {
395 .cls = &pxa_gpio_sysclass, 371 .cls = &pxa_gpio_sysclass,
@@ -420,4 +396,4 @@ static int __init pxa27x_init(void)
420 return ret; 396 return ret;
421} 397}
422 398
423subsys_initcall(pxa27x_init); 399postcore_initcall(pxa27x_init);