aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vp.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-10-06 20:19:45 -0500
committerTodd Poynor <toddpoynor@google.com>2011-10-10 15:51:36 -0700
commit11673a7e7ed6d763f9bb30570b88557ea328267d (patch)
treef2b42779d953f8fdaf0e7609e5cc5b1b14b794a5 /arch/arm/mach-omap2/vp.c
parent808183af3b3cbdc901e6660f8915927e69796778 (diff)
downloadkernel_samsung_tuna-11673a7e7ed6d763f9bb30570b88557ea328267d.zip
kernel_samsung_tuna-11673a7e7ed6d763f9bb30570b88557ea328267d.tar.gz
kernel_samsung_tuna-11673a7e7ed6d763f9bb30570b88557ea328267d.tar.bz2
OMAP3+: PM: VP: check to ensure VP is idle before forceupdate
Ideally in the flow of programming, VP should be in idle state (since we disabled it) before entering forceupdate. Ensure that this is the case. Change-Id: Ibdd9d213511ca9380d91d499ec83558d314d3185 Signed-off-by: Vinay Amancha <vinaykumar@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vp.c')
-rw-r--r--arch/arm/mach-omap2/vp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index 3aa6e11..5cdeab7 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -126,6 +126,18 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
u8 target_vsel, current_vsel;
int ret, timeout = 0;
+ /*
+ * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us
+ * This is an additional allowance to ensure we are in proper state
+ * to enter into forceupdate state transition.
+ */
+ omap_test_timeout((voltdm->read(vp->vstatus)), VP_IDLE_TIMEOUT,
+ timeout);
+
+ if (timeout >= VP_IDLE_TIMEOUT)
+ pr_warning("%s: vdd_%s idle timedout forceupdate(v=%ld)\n",
+ __func__, voltdm->name, target_volt);
+
ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, &current_vsel);
if (ret)
return ret;