aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c24xx
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2013-02-12 13:09:10 -0500
committerKukjin Kim <kgene.kim@samsung.com>2013-03-05 06:20:59 -0500
commit592957085e3763b9339a6a281f1aeb1247cdd245 (patch)
treeebecf19830b1dddb590fa2923c9a8cec8788b6d9 /arch/arm/mach-s3c24xx
parentf0301673ff7ad8aae45c4a95613771d34b1cf052 (diff)
ARM: S3C24XX: use samsung_sync_wakemask in s3c2412 pm
Originally the s3c2412 used a overidden irq chip to set the rtc wakeup flag. But with using the samsung_sync_wakemask function the same can be achieved without introducing soc specific irq functions. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c24xx')
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig1
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2412.c23
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2412.c8
3 files changed, 9 insertions, 23 deletions
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 0c5e4fb61117..0a8663c5f2ba 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -407,6 +407,7 @@ config S3C2412_DMA
407config S3C2412_PM 407config S3C2412_PM
408 bool 408 bool
409 select S3C2412_PM_SLEEP 409 select S3C2412_PM_SLEEP
410 select SAMSUNG_WAKEMASK
410 help 411 help
411 Internal config node to apply S3C2412 power management 412 Internal config node to apply S3C2412 power management
412 413
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2412.c b/arch/arm/mach-s3c24xx/irq-s3c2412.c
index 67d763178d3f..e6fd954c5fd4 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2412.c
@@ -155,22 +155,6 @@ static struct irq_chip s3c2412_irq_cfsdi = {
155 .irq_unmask = s3c2412_irq_cfsdi_unmask, 155 .irq_unmask = s3c2412_irq_cfsdi_unmask,
156}; 156};
157 157
158static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state)
159{
160 unsigned long pwrcfg;
161
162 pwrcfg = __raw_readl(S3C2412_PWRCFG);
163 if (state)
164 pwrcfg &= ~S3C2412_PWRCFG_RTC_MASKIRQ;
165 else
166 pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ;
167 __raw_writel(pwrcfg, S3C2412_PWRCFG);
168
169 return s3c_irq_chip.irq_set_wake(data, state);
170}
171
172static struct irq_chip s3c2412_irq_rtc_chip;
173
174static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif) 158static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
175{ 159{
176 unsigned int irqno; 160 unsigned int irqno;
@@ -191,13 +175,6 @@ static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
191 set_irq_flags(irqno, IRQF_VALID); 175 set_irq_flags(irqno, IRQF_VALID);
192 } 176 }
193 177
194 /* change RTC IRQ's set wake method */
195
196 s3c2412_irq_rtc_chip = s3c_irq_chip;
197 s3c2412_irq_rtc_chip.irq_set_wake = s3c2412_irq_rtc_wake;
198
199 irq_set_chip(IRQ_RTC, &s3c2412_irq_rtc_chip);
200
201 return 0; 178 return 0;
202} 179}
203 180
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2412.c b/arch/arm/mach-s3c24xx/pm-s3c2412.c
index 4c4bc1c83b77..d75f95e487ee 100644
--- a/arch/arm/mach-s3c24xx/pm-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2412.c
@@ -29,6 +29,7 @@
29 29
30#include <plat/cpu.h> 30#include <plat/cpu.h>
31#include <plat/pm.h> 31#include <plat/pm.h>
32#include <plat/wakeup-mask.h>
32 33
33#include "regs-dsc.h" 34#include "regs-dsc.h"
34#include "s3c2412-power.h" 35#include "s3c2412-power.h"
@@ -51,8 +52,15 @@ static int s3c2412_cpu_suspend(unsigned long arg)
51 return 1; /* Aborting suspend */ 52 return 1; /* Aborting suspend */
52} 53}
53 54
55/* mapping of interrupts to parts of the wakeup mask */
56static struct samsung_wakeup_mask wake_irqs[] = {
57 { .irq = IRQ_RTC, .bit = S3C2412_PWRCFG_RTC_MASKIRQ, },
58};
59
54static void s3c2412_pm_prepare(void) 60static void s3c2412_pm_prepare(void)
55{ 61{
62 samsung_sync_wakemask(S3C2412_PWRCFG,
63 wake_irqs, ARRAY_SIZE(wake_irqs));
56} 64}
57 65
58static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif) 66static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif)