]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/plat-s3c/pm.c
[ARM] S3C: Make IRQ_EINT sleep control common
[linux-2.6-omap-h63xx.git] / arch / arm / plat-s3c / pm.c
index fea58bea973d310390b3175cf7c3ac283a114e90..7c736deff8ae261ce61e755d1c2bfa5a521cce7f 100644 (file)
@@ -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 */