diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-12-18 09:59:37 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-01-07 09:01:58 -0500 |
commit | ead9e2936b071a501f7c7ff709802ea4257cd23a (patch) | |
tree | 284e6907de58149f753b6b7d8fd3ab4f180c97e9 /arch/arm/mach-ux500/pm.c | |
parent | 8ffc05f1538844a25fe9c57ce7badbfff4232a1f (diff) |
ARM: ux500: Enable system suspend with WFI support
When building for CONFIG_SUSPEND, add the platform suspend callbacks
to enable system suspend for ux500.
At this initial step, only WFI state is supported, which is reached
for both PM_SUSPEND_MEM and PM_SUSPEND_STANDBY.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/pm.c')
-rw-r--r-- | arch/arm/mach-ux500/pm.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c index 1a468f0fd22e..b80a9a2e356e 100644 --- a/arch/arm/mach-ux500/pm.c +++ b/arch/arm/mach-ux500/pm.c | |||
@@ -3,6 +3,8 @@ | |||
3 | * Author: Rickard Andersson <rickard.andersson@stericsson.com> for | 3 | * Author: Rickard Andersson <rickard.andersson@stericsson.com> for |
4 | * ST-Ericsson. | 4 | * ST-Ericsson. |
5 | * Author: Daniel Lezcano <daniel.lezcano@linaro.org> for Linaro. | 5 | * Author: Daniel Lezcano <daniel.lezcano@linaro.org> for Linaro. |
6 | * Author: Ulf Hansson <ulf.hansson@linaro.org> for Linaro. | ||
7 | * | ||
6 | * License terms: GNU General Public License (GPL) version 2 | 8 | * License terms: GNU General Public License (GPL) version 2 |
7 | * | 9 | * |
8 | */ | 10 | */ |
@@ -11,6 +13,7 @@ | |||
11 | #include <linux/irqchip/arm-gic.h> | 13 | #include <linux/irqchip/arm-gic.h> |
12 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
13 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/suspend.h> | ||
14 | #include <linux/platform_data/arm-ux500-pm.h> | 17 | #include <linux/platform_data/arm-ux500-pm.h> |
15 | 18 | ||
16 | #include "db8500-regs.h" | 19 | #include "db8500-regs.h" |
@@ -152,6 +155,27 @@ int prcmu_copy_gic_settings(void) | |||
152 | return 0; | 155 | return 0; |
153 | } | 156 | } |
154 | 157 | ||
158 | #ifdef CONFIG_SUSPEND | ||
159 | static int ux500_suspend_enter(suspend_state_t state) | ||
160 | { | ||
161 | cpu_do_idle(); | ||
162 | return 0; | ||
163 | } | ||
164 | |||
165 | static int ux500_suspend_valid(suspend_state_t state) | ||
166 | { | ||
167 | return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY; | ||
168 | } | ||
169 | |||
170 | static const struct platform_suspend_ops ux500_suspend_ops = { | ||
171 | .enter = ux500_suspend_enter, | ||
172 | .valid = ux500_suspend_valid, | ||
173 | }; | ||
174 | #define UX500_SUSPEND_OPS (&ux500_suspend_ops) | ||
175 | #else | ||
176 | #define UX500_SUSPEND_OPS NULL | ||
177 | #endif | ||
178 | |||
155 | void __init ux500_pm_init(u32 phy_base, u32 size) | 179 | void __init ux500_pm_init(u32 phy_base, u32 size) |
156 | { | 180 | { |
157 | prcmu_base = ioremap(phy_base, size); | 181 | prcmu_base = ioremap(phy_base, size); |
@@ -164,4 +188,7 @@ void __init ux500_pm_init(u32 phy_base, u32 size) | |||
164 | * This will make sure that the GIC is correctly configured. | 188 | * This will make sure that the GIC is correctly configured. |
165 | */ | 189 | */ |
166 | prcmu_gic_recouple(); | 190 | prcmu_gic_recouple(); |
191 | |||
192 | /* Set up ux500 suspend callbacks. */ | ||
193 | suspend_set_ops(UX500_SUSPEND_OPS); | ||
167 | } | 194 | } |