aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/pm.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-02-02 09:43:20 +0100
committerIngo Molnar <mingo@kernel.org>2014-02-02 09:43:20 +0100
commit65370bdf881e20907e7a53abab9b8c0bc5f60a6b (patch)
tree0d32a494e873b7b92dbfab0e67ffeef597ee8108 /arch/arm/mach-ux500/pm.c
parentlocking/mcs: Allow architectures to hook in to contended paths (diff)
parentMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild (diff)
downloadlinux-dev-65370bdf881e20907e7a53abab9b8c0bc5f60a6b.tar.xz
linux-dev-65370bdf881e20907e7a53abab9b8c0bc5f60a6b.zip
Merge branch 'linus' into core/locking
Refresh the topic. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm/mach-ux500/pm.c')
-rw-r--r--arch/arm/mach-ux500/pm.c27
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 @@
* Author: Rickard Andersson <rickard.andersson@stericsson.com> for
* ST-Ericsson.
* Author: Daniel Lezcano <daniel.lezcano@linaro.org> for Linaro.
+ * Author: Ulf Hansson <ulf.hansson@linaro.org> for Linaro.
+ *
* License terms: GNU General Public License (GPL) version 2
*
*/
@@ -11,6 +13,7 @@
#include <linux/irqchip/arm-gic.h>
#include <linux/delay.h>
#include <linux/io.h>
+#include <linux/suspend.h>
#include <linux/platform_data/arm-ux500-pm.h>
#include "db8500-regs.h"
@@ -152,6 +155,27 @@ int prcmu_copy_gic_settings(void)
return 0;
}
+#ifdef CONFIG_SUSPEND
+static int ux500_suspend_enter(suspend_state_t state)
+{
+ cpu_do_idle();
+ return 0;
+}
+
+static int ux500_suspend_valid(suspend_state_t state)
+{
+ return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
+}
+
+static const struct platform_suspend_ops ux500_suspend_ops = {
+ .enter = ux500_suspend_enter,
+ .valid = ux500_suspend_valid,
+};
+#define UX500_SUSPEND_OPS (&ux500_suspend_ops)
+#else
+#define UX500_SUSPEND_OPS NULL
+#endif
+
void __init ux500_pm_init(u32 phy_base, u32 size)
{
prcmu_base = ioremap(phy_base, size);
@@ -164,4 +188,7 @@ void __init ux500_pm_init(u32 phy_base, u32 size)
* This will make sure that the GIC is correctly configured.
*/
prcmu_gic_recouple();
+
+ /* Set up ux500 suspend callbacks. */
+ suspend_set_ops(UX500_SUSPEND_OPS);
}