aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2412
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-12-22 21:09:33 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-28 08:20:50 -0500
commit0baada2742a42390a2ebed09e07e1fab518db884 (patch)
treef66d3dc70e4f6975df3d581d972cc1bb342dc028 /arch/arm/mach-s3c2412
parent8e3007a0e8a0d2f5e3139cb9fe606c2a998b9ed3 (diff)
[ARM] 4730/1: S3C2412: Ensure the PWRCFG has the right mode for RTC wake
Ensure that if the RTC IRQ is not selected for wake in the base configuration, then the PWRCFG has the same value set in it. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2412')
-rw-r--r--arch/arm/mach-s3c2412/irq.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c
index e9d0c769f5da..cc1917bf952a 100644
--- a/arch/arm/mach-s3c2412/irq.c
+++ b/arch/arm/mach-s3c2412/irq.c
@@ -33,6 +33,7 @@
33 33
34#include <asm/arch/regs-irq.h> 34#include <asm/arch/regs-irq.h>
35#include <asm/arch/regs-gpio.h> 35#include <asm/arch/regs-gpio.h>
36#include <asm/arch/regs-power.h>
36 37
37#include <asm/plat-s3c24xx/cpu.h> 38#include <asm/plat-s3c24xx/cpu.h>
38#include <asm/plat-s3c24xx/irq.h> 39#include <asm/plat-s3c24xx/irq.h>
@@ -153,6 +154,22 @@ static struct irq_chip s3c2412_irq_cfsdi = {
153 .unmask = s3c2412_irq_cfsdi_unmask, 154 .unmask = s3c2412_irq_cfsdi_unmask,
154}; 155};
155 156
157static int s3c2412_irq_rtc_wake(unsigned int irqno, unsigned int state)
158{
159 unsigned long pwrcfg;
160
161 pwrcfg = __raw_readl(S3C2412_PWRCFG);
162 if (state)
163 pwrcfg &= ~S3C2412_PWRCFG_RTC_MASKIRQ;
164 else
165 pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ;
166 __raw_writel(pwrcfg, S3C2412_PWRCFG);
167
168 return s3c_irq_chip.set_wake(irqno, state);
169}
170
171static struct irq_chip s3c2412_irq_rtc_chip;
172
156static int s3c2412_irq_add(struct sys_device *sysdev) 173static int s3c2412_irq_add(struct sys_device *sysdev)
157{ 174{
158 unsigned int irqno; 175 unsigned int irqno;
@@ -173,6 +190,13 @@ static int s3c2412_irq_add(struct sys_device *sysdev)
173 set_irq_flags(irqno, IRQF_VALID); 190 set_irq_flags(irqno, IRQF_VALID);
174 } 191 }
175 192
193 /* change RTC IRQ's set wake method */
194
195 s3c2412_irq_rtc_chip = s3c_irq_chip;
196 s3c2412_irq_rtc_chip.set_wake = s3c2412_irq_rtc_wake;
197
198 set_irq_chip(IRQ_RTC, &s3c2412_irq_rtc_chip);
199
176 return 0; 200 return 0;
177} 201}
178 202