diff options
author | Rob Herring <rob.herring@calxeda.com> | 2011-05-15 13:44:17 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 09:14:05 -0400 |
commit | 8b61f37440388ebbd2a894178fe098f2e70ab392 (patch) | |
tree | 15d6b6941337c1d220b19459a3887809165a0812 /arch/arm/mach-highbank | |
parent | 9680b3d04d27ed90479eb84d2054ddd3deb83d5e (diff) |
ARM: highbank: add suspend support
Add the platform suspend ops for highbank.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-highbank')
-rw-r--r-- | arch/arm/mach-highbank/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-highbank/pm.c | 55 |
2 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile index c45078f820ae..986958a5a720 100644 --- a/arch/arm/mach-highbank/Makefile +++ b/arch/arm/mach-highbank/Makefile | |||
@@ -3,3 +3,4 @@ obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o | |||
3 | obj-$(CONFIG_SMP) += platsmp.o | 3 | obj-$(CONFIG_SMP) += platsmp.o |
4 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | 4 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o |
5 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 5 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
6 | obj-$(CONFIG_PM_SLEEP) += pm.o | ||
diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c new file mode 100644 index 000000000000..33b3beb89982 --- /dev/null +++ b/arch/arm/mach-highbank/pm.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Calxeda, Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include <linux/init.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/suspend.h> | ||
20 | |||
21 | #include <asm/proc-fns.h> | ||
22 | #include <asm/smp_scu.h> | ||
23 | #include <asm/suspend.h> | ||
24 | |||
25 | #include "core.h" | ||
26 | #include "sysregs.h" | ||
27 | |||
28 | static int highbank_suspend_finish(unsigned long val) | ||
29 | { | ||
30 | cpu_do_idle(); | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | static int highbank_pm_enter(suspend_state_t state) | ||
35 | { | ||
36 | hignbank_set_pwr_suspend(); | ||
37 | highbank_set_cpu_jump(0, cpu_resume); | ||
38 | |||
39 | scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); | ||
40 | cpu_suspend(0, highbank_suspend_finish); | ||
41 | |||
42 | return 0; | ||
43 | } | ||
44 | |||
45 | static const struct platform_suspend_ops highbank_pm_ops = { | ||
46 | .enter = highbank_pm_enter, | ||
47 | .valid = suspend_valid_only_mem, | ||
48 | }; | ||
49 | |||
50 | static int __init highbank_pm_init(void) | ||
51 | { | ||
52 | suspend_set_ops(&highbank_pm_ops); | ||
53 | return 0; | ||
54 | } | ||
55 | module_init(highbank_pm_init); | ||