Commit 26f90818 authored by David Anders's avatar David Anders Committed by Russell King

[ARM] 3862/2: S3C2410 - add basic power management support for AML M5900 series

this patch registers the wakeup irq, sets a gpio pin to indicate the
status of system for suspend/resume operations, and adds the machine to
the supported machines for use with the simtec-pm
Signed-off-by: default avatarDavid Anders <danders@amltd.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent ea33a598
...@@ -292,7 +292,7 @@ config S3C2410_PM_CHECK_CHUNKSIZE ...@@ -292,7 +292,7 @@ config S3C2410_PM_CHECK_CHUNKSIZE
config PM_SIMTEC config PM_SIMTEC
bool bool
depends on PM && (ARCH_BAST || MACH_VR1000) depends on PM && (ARCH_BAST || MACH_VR1000 || MACH_AML_M5900)
default y default y
config S3C2410_LOWLEVEL_UART_PORT config S3C2410_LOWLEVEL_UART_PORT
......
...@@ -225,13 +225,34 @@ static struct s3c2410fb_mach_info __initdata amlm5900_lcd_info = { ...@@ -225,13 +225,34 @@ static struct s3c2410fb_mach_info __initdata amlm5900_lcd_info = {
}; };
#endif #endif
static void __init amlm5900_init(void) static irqreturn_t
amlm5900_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
{ {
return IRQ_HANDLED;
}
static void amlm5900_init_pm(void)
{
int ret = 0;
ret = request_irq(IRQ_EINT9, &amlm5900_wake_interrupt,
IRQF_TRIGGER_RISING | IRQF_SHARED,
"amlm5900_wakeup", &amlm5900_wake_interrupt);
if (ret != 0) {
printk(KERN_ERR "AML-M5900: no wakeup irq, %d?\n", ret);
} else {
enable_irq_wake(IRQ_EINT9);
/* configure the suspend/resume status pin */
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP);
s3c2410_gpio_pullup(S3C2410_GPF2, 0);
}
}
static void __init amlm5900_init(void)
{
amlm5900_init_pm();
#ifdef CONFIG_FB_S3C2410 #ifdef CONFIG_FB_S3C2410
s3c24xx_fb_set_platdata(&amlm5900_lcd_info); s3c24xx_fb_set_platdata(&amlm5900_lcd_info);
#endif #endif
} }
MACHINE_START(AML_M5900, "AML_M5900") MACHINE_START(AML_M5900, "AML_M5900")
......
...@@ -49,7 +49,8 @@ static __init int pm_simtec_init(void) ...@@ -49,7 +49,8 @@ static __init int pm_simtec_init(void)
/* check which machine we are running on */ /* check which machine we are running on */
if (!machine_is_bast() && !machine_is_vr1000() && if (!machine_is_bast() && !machine_is_vr1000() &&
!machine_is_anubis() && !machine_is_osiris()) !machine_is_anubis() && !machine_is_osiris() &&
!machine_is_aml_m5900())
return 0; return 0;
printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n"); printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n");
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/mach-types.h>
#include <asm/arch/regs-gpio.h> #include <asm/arch/regs-gpio.h>
#include "cpu.h" #include "cpu.h"
...@@ -49,6 +51,10 @@ static void s3c2410_pm_prepare(void) ...@@ -49,6 +51,10 @@ static void s3c2410_pm_prepare(void)
DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
if ( machine_is_aml_m5900() )
s3c2410_gpio_setpin(S3C2410_GPF2, 1);
} }
int s3c2410_pm_resume(struct sys_device *dev) int s3c2410_pm_resume(struct sys_device *dev)
...@@ -61,6 +67,9 @@ int s3c2410_pm_resume(struct sys_device *dev) ...@@ -61,6 +67,9 @@ int s3c2410_pm_resume(struct sys_device *dev)
tmp &= S3C2410_GSTATUS2_OFFRESET; tmp &= S3C2410_GSTATUS2_OFFRESET;
__raw_writel(tmp, S3C2410_GSTATUS2); __raw_writel(tmp, S3C2410_GSTATUS2);
if ( machine_is_aml_m5900() )
s3c2410_gpio_setpin(S3C2410_GPF2, 0);
return 0; return 0;
} }
......
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