diff options
author | David Anders <danders@amltd.com> | 2006-09-26 12:46:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-27 18:44:33 -0400 |
commit | 26f908186f923291999833e9d563259834bdca06 (patch) | |
tree | 3fd7656ade08d17d6213fdaa27c86bda6f4b0b8b /arch | |
parent | ea33a59802f8fd21d24fbf5c906bc3f399bcca00 (diff) |
[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: David Anders <danders@amltd.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c2410/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-amlm5900.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/pm-simtec.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/s3c2410-pm.c | 9 |
4 files changed, 35 insertions, 4 deletions
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index e50a73f93d3d..df37594c30f8 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig | |||
@@ -292,7 +292,7 @@ config S3C2410_PM_CHECK_CHUNKSIZE | |||
292 | 292 | ||
293 | config PM_SIMTEC | 293 | config PM_SIMTEC |
294 | bool | 294 | bool |
295 | depends on PM && (ARCH_BAST || MACH_VR1000) | 295 | depends on PM && (ARCH_BAST || MACH_VR1000 || MACH_AML_M5900) |
296 | default y | 296 | default y |
297 | 297 | ||
298 | config S3C2410_LOWLEVEL_UART_PORT | 298 | config S3C2410_LOWLEVEL_UART_PORT |
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c index 0c9b7dafbe90..ba5109af40b4 100644 --- a/arch/arm/mach-s3c2410/mach-amlm5900.c +++ b/arch/arm/mach-s3c2410/mach-amlm5900.c | |||
@@ -225,13 +225,34 @@ static struct s3c2410fb_mach_info __initdata amlm5900_lcd_info = { | |||
225 | }; | 225 | }; |
226 | #endif | 226 | #endif |
227 | 227 | ||
228 | static void __init amlm5900_init(void) | 228 | static irqreturn_t |
229 | amlm5900_wake_interrupt(int irq, void *ignored, struct pt_regs *regs) | ||
229 | { | 230 | { |
231 | return IRQ_HANDLED; | ||
232 | } | ||
230 | 233 | ||
234 | static void amlm5900_init_pm(void) | ||
235 | { | ||
236 | int ret = 0; | ||
237 | |||
238 | ret = request_irq(IRQ_EINT9, &amlm5900_wake_interrupt, | ||
239 | IRQF_TRIGGER_RISING | IRQF_SHARED, | ||
240 | "amlm5900_wakeup", &amlm5900_wake_interrupt); | ||
241 | if (ret != 0) { | ||
242 | printk(KERN_ERR "AML-M5900: no wakeup irq, %d?\n", ret); | ||
243 | } else { | ||
244 | enable_irq_wake(IRQ_EINT9); | ||
245 | /* configure the suspend/resume status pin */ | ||
246 | s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); | ||
247 | s3c2410_gpio_pullup(S3C2410_GPF2, 0); | ||
248 | } | ||
249 | } | ||
250 | static void __init amlm5900_init(void) | ||
251 | { | ||
252 | amlm5900_init_pm(); | ||
231 | #ifdef CONFIG_FB_S3C2410 | 253 | #ifdef CONFIG_FB_S3C2410 |
232 | s3c24xx_fb_set_platdata(&amlm5900_lcd_info); | 254 | s3c24xx_fb_set_platdata(&amlm5900_lcd_info); |
233 | #endif | 255 | #endif |
234 | |||
235 | } | 256 | } |
236 | 257 | ||
237 | MACHINE_START(AML_M5900, "AML_M5900") | 258 | MACHINE_START(AML_M5900, "AML_M5900") |
diff --git a/arch/arm/mach-s3c2410/pm-simtec.c b/arch/arm/mach-s3c2410/pm-simtec.c index 7b244566a436..42cd05e298f8 100644 --- a/arch/arm/mach-s3c2410/pm-simtec.c +++ b/arch/arm/mach-s3c2410/pm-simtec.c | |||
@@ -49,7 +49,8 @@ static __init int pm_simtec_init(void) | |||
49 | /* check which machine we are running on */ | 49 | /* check which machine we are running on */ |
50 | 50 | ||
51 | if (!machine_is_bast() && !machine_is_vr1000() && | 51 | if (!machine_is_bast() && !machine_is_vr1000() && |
52 | !machine_is_anubis() && !machine_is_osiris()) | 52 | !machine_is_anubis() && !machine_is_osiris() && |
53 | !machine_is_aml_m5900()) | ||
53 | return 0; | 54 | return 0; |
54 | 55 | ||
55 | printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n"); | 56 | printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n"); |
diff --git a/arch/arm/mach-s3c2410/s3c2410-pm.c b/arch/arm/mach-s3c2410/s3c2410-pm.c index 3080d25a12de..e51d76669512 100644 --- a/arch/arm/mach-s3c2410/s3c2410-pm.c +++ b/arch/arm/mach-s3c2410/s3c2410-pm.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <asm/hardware.h> | 29 | #include <asm/hardware.h> |
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | 31 | ||
32 | #include <asm/mach-types.h> | ||
33 | |||
32 | #include <asm/arch/regs-gpio.h> | 34 | #include <asm/arch/regs-gpio.h> |
33 | 35 | ||
34 | #include "cpu.h" | 36 | #include "cpu.h" |
@@ -49,6 +51,10 @@ static void s3c2410_pm_prepare(void) | |||
49 | 51 | ||
50 | DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); | 52 | DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); |
51 | DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); | 53 | DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); |
54 | |||
55 | if ( machine_is_aml_m5900() ) | ||
56 | s3c2410_gpio_setpin(S3C2410_GPF2, 1); | ||
57 | |||
52 | } | 58 | } |
53 | 59 | ||
54 | int s3c2410_pm_resume(struct sys_device *dev) | 60 | int s3c2410_pm_resume(struct sys_device *dev) |
@@ -61,6 +67,9 @@ int s3c2410_pm_resume(struct sys_device *dev) | |||
61 | tmp &= S3C2410_GSTATUS2_OFFRESET; | 67 | tmp &= S3C2410_GSTATUS2_OFFRESET; |
62 | __raw_writel(tmp, S3C2410_GSTATUS2); | 68 | __raw_writel(tmp, S3C2410_GSTATUS2); |
63 | 69 | ||
70 | if ( machine_is_aml_m5900() ) | ||
71 | s3c2410_gpio_setpin(S3C2410_GPF2, 0); | ||
72 | |||
64 | return 0; | 73 | return 0; |
65 | } | 74 | } |
66 | 75 | ||