diff options
-rw-r--r-- | arch/arm/mach-mx5/pm-imx5.c | 15 |
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 e4529af0da72..be19e9ce839a 100644 --- a/arch/arm/mach-mx5/pm-imx5.c +++ b/arch/arm/mach-mx5/pm-imx5.c | |||
@@ -19,9 +19,13 @@ | |||
19 | 19 | ||
20 | static struct clk *gpc_dvfs_clk; | 20 | static struct clk *gpc_dvfs_clk; |
21 | 21 | ||
22 | static int mx5_suspend_prepare(void) | ||
23 | { | ||
24 | return clk_enable(gpc_dvfs_clk); | ||
25 | } | ||
26 | |||
22 | static int mx5_suspend_enter(suspend_state_t state) | 27 | static int mx5_suspend_enter(suspend_state_t state) |
23 | { | 28 | { |
24 | clk_enable(gpc_dvfs_clk); | ||
25 | switch (state) { | 29 | switch (state) { |
26 | case PM_SUSPEND_MEM: | 30 | case PM_SUSPEND_MEM: |
27 | mx5_cpu_lp_set(STOP_POWER_OFF); | 31 | mx5_cpu_lp_set(STOP_POWER_OFF); |
@@ -42,11 +46,14 @@ static int mx5_suspend_enter(suspend_state_t state) | |||
42 | __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR); | 46 | __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR); |
43 | } | 47 | } |
44 | cpu_do_idle(); | 48 | cpu_do_idle(); |
45 | clk_disable(gpc_dvfs_clk); | ||
46 | |||
47 | return 0; | 49 | return 0; |
48 | } | 50 | } |
49 | 51 | ||
52 | static void mx5_suspend_finish(void) | ||
53 | { | ||
54 | clk_disable(gpc_dvfs_clk); | ||
55 | } | ||
56 | |||
50 | static int mx5_pm_valid(suspend_state_t state) | 57 | static int mx5_pm_valid(suspend_state_t state) |
51 | { | 58 | { |
52 | return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX); | 59 | return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX); |
@@ -54,7 +61,9 @@ static int mx5_pm_valid(suspend_state_t state) | |||
54 | 61 | ||
55 | static const struct platform_suspend_ops mx5_suspend_ops = { | 62 | static const struct platform_suspend_ops mx5_suspend_ops = { |
56 | .valid = mx5_pm_valid, | 63 | .valid = mx5_pm_valid, |
64 | .prepare = mx5_suspend_prepare, | ||
57 | .enter = mx5_suspend_enter, | 65 | .enter = mx5_suspend_enter, |
66 | .finish = mx5_suspend_finish, | ||
58 | }; | 67 | }; |
59 | 68 | ||
60 | static int __init mx5_pm_init(void) | 69 | static int __init mx5_pm_init(void) |