aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5/pm-imx5.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx5/pm-imx5.c')
-rw-r--r--arch/arm/mach-mx5/pm-imx5.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c
index 0624fb8edffb..98052fc852c7 100644
--- a/arch/arm/mach-mx5/pm-imx5.c
+++ b/arch/arm/mach-mx5/pm-imx5.c
@@ -20,9 +20,13 @@
20 20
21static struct clk *gpc_dvfs_clk; 21static struct clk *gpc_dvfs_clk;
22 22
23static int mx5_suspend_prepare(void)
24{
25 return clk_enable(gpc_dvfs_clk);
26}
27
23static int mx5_suspend_enter(suspend_state_t state) 28static int mx5_suspend_enter(suspend_state_t state)
24{ 29{
25 clk_enable(gpc_dvfs_clk);
26 switch (state) { 30 switch (state) {
27 case PM_SUSPEND_MEM: 31 case PM_SUSPEND_MEM:
28 mx5_cpu_lp_set(STOP_POWER_OFF); 32 mx5_cpu_lp_set(STOP_POWER_OFF);
@@ -43,11 +47,14 @@ static int mx5_suspend_enter(suspend_state_t state)
43 __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR); 47 __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR);
44 } 48 }
45 cpu_do_idle(); 49 cpu_do_idle();
46 clk_disable(gpc_dvfs_clk);
47
48 return 0; 50 return 0;
49} 51}
50 52
53static void mx5_suspend_finish(void)
54{
55 clk_disable(gpc_dvfs_clk);
56}
57
51static int mx5_pm_valid(suspend_state_t state) 58static int mx5_pm_valid(suspend_state_t state)
52{ 59{
53 return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX); 60 return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
@@ -55,7 +62,9 @@ static int mx5_pm_valid(suspend_state_t state)
55 62
56static const struct platform_suspend_ops mx5_suspend_ops = { 63static const struct platform_suspend_ops mx5_suspend_ops = {
57 .valid = mx5_pm_valid, 64 .valid = mx5_pm_valid,
65 .prepare = mx5_suspend_prepare,
58 .enter = mx5_suspend_enter, 66 .enter = mx5_suspend_enter,
67 .finish = mx5_suspend_finish,
59}; 68};
60 69
61static int __init mx5_pm_init(void) 70static int __init mx5_pm_init(void)