diff options
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c24a0/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/pm.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c/pm.c | 24 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/irq.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/irq-pm.c | 23 |
6 files changed, 30 insertions, 25 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h index 49efce8cd4a..0cd89b73577 100644 --- a/arch/arm/mach-s3c2410/include/mach/irqs.h +++ b/arch/arm/mach-s3c2410/include/mach/irqs.h @@ -80,7 +80,7 @@ #define IRQ_EINT22 S3C2410_IRQ(50) #define IRQ_EINT23 S3C2410_IRQ(51) - +#define IRQ_EINT_BIT(x) ((x) - (IRQ_EINT4 + 4)) #define IRQ_EINT(x) (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x))) #define IRQ_LCD_FIFO S3C2410_IRQ(52) diff --git a/arch/arm/mach-s3c24a0/include/mach/irqs.h b/arch/arm/mach-s3c24a0/include/mach/irqs.h index ae8c0e35978..83ce2a7a9da 100644 --- a/arch/arm/mach-s3c24a0/include/mach/irqs.h +++ b/arch/arm/mach-s3c24a0/include/mach/irqs.h @@ -70,6 +70,8 @@ #define IRQ_EINT17 S3C2410_IRQ(49) #define IRQ_EINT18 S3C2410_IRQ(50) +#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT00) + /* SUB IRQS */ #define IRQ_S3CUART_RX0 S3C2410_IRQ(51) /* 67 */ #define IRQ_S3CUART_TX0 S3C2410_IRQ(52) diff --git a/arch/arm/plat-s3c/include/plat/pm.h b/arch/arm/plat-s3c/include/plat/pm.h index 42c75e6d2ba..5e27de955da 100644 --- a/arch/arm/plat-s3c/include/plat/pm.h +++ b/arch/arm/plat-s3c/include/plat/pm.h @@ -77,9 +77,11 @@ extern void s3c_pm_do_restore(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); #ifdef CONFIG_PM +extern int s3c_irqext_wake(unsigned int irqno, unsigned int state); extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); extern int s3c24xx_irq_resume(struct sys_device *dev); #else +#define s3c_irqext_wake NULL #define s3c24xx_irq_suspend NULL #define s3c24xx_irq_resume NULL #endif diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c index fea58bea973..7c736deff8a 100644 --- a/arch/arm/plat-s3c/pm.c +++ b/arch/arm/plat-s3c/pm.c @@ -27,6 +27,7 @@ #include <mach/regs-gpio.h> #include <mach/regs-mem.h> #include <mach/regs-irq.h> +#include <asm/irq.h> #include <plat/pm.h> #include <plat/pm-core.h> @@ -100,6 +101,29 @@ static void s3c_pm_save_uart(void) { } static void s3c_pm_restore_uart(void) { } #endif +/* The IRQ ext-int code goes here, it is too small to currently bother + * with its own file. */ + +unsigned long s3c_irqwake_intmask = 0xffffffffL; +unsigned long s3c_irqwake_eintmask = 0xffffffffL; + +int s3c_irqext_wake(unsigned int irqno, unsigned int state) +{ + unsigned long bit = 1L << IRQ_EINT_BIT(irqno); + + if (!(s3c_irqwake_eintallow & bit)) + return -ENOENT; + + printk(KERN_INFO "wake %s for irq %d\n", + state ? "enabled" : "disabled", irqno); + + if (!state) + s3c_irqwake_eintmask |= bit; + else + s3c_irqwake_eintmask &= ~bit; + + return 0; +} /* helper functions to save and restore register state */ diff --git a/arch/arm/plat-s3c24xx/include/plat/irq.h b/arch/arm/plat-s3c24xx/include/plat/irq.h index 97b6884ea0d..69e1be8bec3 100644 --- a/arch/arm/plat-s3c24xx/include/plat/irq.h +++ b/arch/arm/plat-s3c24xx/include/plat/irq.h @@ -108,9 +108,7 @@ s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group) #ifdef CONFIG_PM extern int s3c_irq_wake(unsigned int irqno, unsigned int state); -extern int s3c_irqext_wake(unsigned int irqno, unsigned int state); #else -#define s3c_irqext_wake NULL #define s3c_irq_wake NULL #endif diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c index 86c68804f09..b7acf1a8ecd 100644 --- a/arch/arm/plat-s3c24xx/irq-pm.c +++ b/arch/arm/plat-s3c24xx/irq-pm.c @@ -28,12 +28,9 @@ */ unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL; -unsigned long s3c_irqwake_intmask = 0xffffffffL; unsigned long s3c_irqwake_eintallow = 0x0000fff0L; -unsigned long s3c_irqwake_eintmask = 0xffffffffL; -int -s3c_irq_wake(unsigned int irqno, unsigned int state) +int s3c_irq_wake(unsigned int irqno, unsigned int state) { unsigned long irqbit = 1 << (irqno - IRQ_EINT0); @@ -51,24 +48,6 @@ s3c_irq_wake(unsigned int irqno, unsigned int state) return 0; } -int s3c_irqext_wake(unsigned int irqno, unsigned int state) -{ - unsigned long bit = 1L << (irqno - EXTINT_OFF); - - if (!(s3c_irqwake_eintallow & bit)) - return -ENOENT; - - printk(KERN_INFO "wake %s for irq %d\n", - state ? "enabled" : "disabled", irqno); - - if (!state) - s3c_irqwake_eintmask |= bit; - else - s3c_irqwake_eintmask &= ~bit; - - return 0; -} - static struct sleep_save irq_save[] = { SAVE_ITEM(S3C2410_INTMSK), SAVE_ITEM(S3C2410_INTSUBMSK), |