diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-12-11 19:24:12 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-03-08 08:35:36 -0400 |
commit | 56b34426888d35b3b6367c216bbfb17b82b4f0ac (patch) | |
tree | 435ec8f8856f222a95dd7c83ace6c01806ba8e5b /arch/arm/plat-s3c/pm.c | |
parent | 7299a40918e15d5f9b4bc7fcb02163c335d92e43 (diff) |
[ARM] S3C: Make IRQ_EINT sleep control common
Move the IRQ_EINT sleep control to be available to all
s3c impelmentations. Since s3c_irqext_wake is not large,
place it in arch/arm/plat-s3c/pm.c as adding it to a new
file would be a waste of compile time.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/pm.c')
-rw-r--r-- | arch/arm/plat-s3c/pm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c index fea58bea973d..7c736deff8ae 100644 --- a/arch/arm/plat-s3c/pm.c +++ b/arch/arm/plat-s3c/pm.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <mach/regs-gpio.h> | 27 | #include <mach/regs-gpio.h> |
28 | #include <mach/regs-mem.h> | 28 | #include <mach/regs-mem.h> |
29 | #include <mach/regs-irq.h> | 29 | #include <mach/regs-irq.h> |
30 | #include <asm/irq.h> | ||
30 | 31 | ||
31 | #include <plat/pm.h> | 32 | #include <plat/pm.h> |
32 | #include <plat/pm-core.h> | 33 | #include <plat/pm-core.h> |
@@ -100,6 +101,29 @@ static void s3c_pm_save_uart(void) { } | |||
100 | static void s3c_pm_restore_uart(void) { } | 101 | static void s3c_pm_restore_uart(void) { } |
101 | #endif | 102 | #endif |
102 | 103 | ||
104 | /* The IRQ ext-int code goes here, it is too small to currently bother | ||
105 | * with its own file. */ | ||
106 | |||
107 | unsigned long s3c_irqwake_intmask = 0xffffffffL; | ||
108 | unsigned long s3c_irqwake_eintmask = 0xffffffffL; | ||
109 | |||
110 | int s3c_irqext_wake(unsigned int irqno, unsigned int state) | ||
111 | { | ||
112 | unsigned long bit = 1L << IRQ_EINT_BIT(irqno); | ||
113 | |||
114 | if (!(s3c_irqwake_eintallow & bit)) | ||
115 | return -ENOENT; | ||
116 | |||
117 | printk(KERN_INFO "wake %s for irq %d\n", | ||
118 | state ? "enabled" : "disabled", irqno); | ||
119 | |||
120 | if (!state) | ||
121 | s3c_irqwake_eintmask |= bit; | ||
122 | else | ||
123 | s3c_irqwake_eintmask &= ~bit; | ||
124 | |||
125 | return 0; | ||
126 | } | ||
103 | 127 | ||
104 | /* helper functions to save and restore register state */ | 128 | /* helper functions to save and restore register state */ |
105 | 129 | ||