summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5/mm.c
diff options
context:
space:
mode:
authorHui Wang2011-10-09 11:42:15 +0200
committerShawn Guo2011-12-25 05:02:28 +0100
commit010dc8af8f283cc04b7d8f8844f01dd90eca69e5 (patch)
treead80b85d64d57137c6464faf4bd16eb4b393d8b7 /arch/arm/mach-mx5/mm.c
parentLinux 3.2-rc7 (diff)
downloadkernel-qcow2-linux-010dc8af8f283cc04b7d8f8844f01dd90eca69e5.tar.gz
kernel-qcow2-linux-010dc8af8f283cc04b7d8f8844f01dd90eca69e5.tar.xz
kernel-qcow2-linux-010dc8af8f283cc04b7d8f8844f01dd90eca69e5.zip
ARM: mx5: use generic irq chip pm interface for pm functions on
Two problems exist in the current i.MX5 pm suspend/resume and idle functions. The first is the current i.MX5 suspend routine will call tzic_enable_wake(1) to set wake source, this will set all enabled irq as wake source rather than those wake capable. The second is i.MX5 idle will call mx5_cpu_lp_set() to prepare enter low power mode, but it forgets to call wfi instruction to enter this mode. To fix these two problems, using generic irq chip pm interface and modify function imx5_idle(). [Tested by Shawn Guo on imx51 babbage board. Tested by Hui Wang on imx51 pdk board.] Signed-off-by: Hui Wang <jason77.wang@gmail.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mx5/mm.c')
-rw-r--r--arch/arm/mach-mx5/mm.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index df4a508f240a..bc17dfea3817 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -13,6 +13,7 @@
#include <linux/mm.h>
#include <linux/init.h>
+#include <linux/clk.h>
#include <asm/mach/map.h>
@@ -21,10 +22,26 @@
#include <mach/devices-common.h>
#include <mach/iomux-v3.h>
+static struct clk *gpc_dvfs_clk;
+
static void imx5_idle(void)
{
- if (!need_resched())
+ if (!need_resched()) {
+ /* gpc clock is needed for SRPG */
+ if (gpc_dvfs_clk == NULL) {
+ gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
+ if (IS_ERR(gpc_dvfs_clk))
+ goto err0;
+ }
+ clk_enable(gpc_dvfs_clk);
mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
+ if (tzic_enable_wake())
+ goto err1;
+ cpu_do_idle();
+err1:
+ clk_disable(gpc_dvfs_clk);
+ }
+err0:
local_irq_enable();
}