msm: pm: Add API to get deep idle latency
Previously a driver could grab an idle wakelock and prevent the
deep idle sleep states associated with remote processor assisted
power collapse (either via the modem or the RPM). With the
removal of idle wakelocks we must replace them with equivalent
upstream compatabile APIs. Since the drivers are actually
expressing their desire to prevent certain CPU latencys add an
API to expose the latency of deep idle sleep to drivers.
It's expected that this API will be removed once drivers properly
specify their latency requirements.
Change-Id: Iebeb17009fca1486fddda4f78f4952080096234a
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/pm2.c b/arch/arm/mach-msm/pm2.c
index bac6ef8..748d612 100644
--- a/arch/arm/mach-msm/pm2.c
+++ b/arch/arm/mach-msm/pm2.c
@@ -394,6 +394,12 @@
return ret;
}
+s32 msm_cpuidle_get_deep_idle_latency(void)
+{
+ int i = MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN);
+ return msm_pm_modes[i].latency - 1;
+}
+
void __init msm_pm_set_platform_data(
struct msm_pm_platform_data *data, int count)
{