Commit 59295708 authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Kukjin Kim

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: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent f0301673
...@@ -407,6 +407,7 @@ config S3C2412_DMA ...@@ -407,6 +407,7 @@ config S3C2412_DMA
config S3C2412_PM config S3C2412_PM
bool bool
select S3C2412_PM_SLEEP select S3C2412_PM_SLEEP
select SAMSUNG_WAKEMASK
help help
Internal config node to apply S3C2412 power management Internal config node to apply S3C2412 power management
......
...@@ -155,22 +155,6 @@ static struct irq_chip s3c2412_irq_cfsdi = { ...@@ -155,22 +155,6 @@ static struct irq_chip s3c2412_irq_cfsdi = {
.irq_unmask = s3c2412_irq_cfsdi_unmask, .irq_unmask = s3c2412_irq_cfsdi_unmask,
}; };
static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state)
{
unsigned long pwrcfg;
pwrcfg = __raw_readl(S3C2412_PWRCFG);
if (state)
pwrcfg &= ~S3C2412_PWRCFG_RTC_MASKIRQ;
else
pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ;
__raw_writel(pwrcfg, S3C2412_PWRCFG);
return s3c_irq_chip.irq_set_wake(data, state);
}
static struct irq_chip s3c2412_irq_rtc_chip;
static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif) static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
{ {
unsigned int irqno; unsigned int irqno;
...@@ -191,13 +175,6 @@ static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif) ...@@ -191,13 +175,6 @@ static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
set_irq_flags(irqno, IRQF_VALID); set_irq_flags(irqno, IRQF_VALID);
} }
/* change RTC IRQ's set wake method */
s3c2412_irq_rtc_chip = s3c_irq_chip;
s3c2412_irq_rtc_chip.irq_set_wake = s3c2412_irq_rtc_wake;
irq_set_chip(IRQ_RTC, &s3c2412_irq_rtc_chip);
return 0; return 0;
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/pm.h> #include <plat/pm.h>
#include <plat/wakeup-mask.h>
#include "regs-dsc.h" #include "regs-dsc.h"
#include "s3c2412-power.h" #include "s3c2412-power.h"
...@@ -51,8 +52,15 @@ static int s3c2412_cpu_suspend(unsigned long arg) ...@@ -51,8 +52,15 @@ static int s3c2412_cpu_suspend(unsigned long arg)
return 1; /* Aborting suspend */ return 1; /* Aborting suspend */
} }
/* mapping of interrupts to parts of the wakeup mask */
static struct samsung_wakeup_mask wake_irqs[] = {
{ .irq = IRQ_RTC, .bit = S3C2412_PWRCFG_RTC_MASKIRQ, },
};
static void s3c2412_pm_prepare(void) static void s3c2412_pm_prepare(void)
{ {
samsung_sync_wakemask(S3C2412_PWRCFG,
wake_irqs, ARRAY_SIZE(wake_irqs));
} }
static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif) static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment