summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamakrishnan Ganesh <ramakris@codeaurora.org>2017-05-26 12:39:38 -0700
committerRamakrishnan Ganesh <ramakris@codeaurora.org>2017-06-22 17:57:53 -0700
commit4fb87c366bd6c78888202fb650f76d04b8deedfc (patch)
tree402c3ad54834046adb4b8cdc363b5612b6a4d0bc
parent17ca958bf394aba1018a57fc65aa773ac64b9ae2 (diff)
soc: qcom: sleepstate: Enable/Disable IPCRTR wakelocks
The acquiring of wakelock prevents the system from entering suspend for high frequency non-wakeup sensor requests. With the change IPCRTR now does not acquire a wakelock while cpu is out of suspend. This allows the cpu to enter suspend. The wakelocks are enabled in the suspend path so that future wakeup capable sensor events gets handled without issues. The wakelocks are disabled post resume from suspend. This change affects only the data on the SLPI edge. Change-Id: Iae3dafb735bfb0d3000487f2fa2216d68e9a026f Signed-off-by: Ramakrishnan Ganesh <ramakris@codeaurora.org>
-rw-r--r--drivers/soc/qcom/smp2p_sleepstate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/soc/qcom/smp2p_sleepstate.c b/drivers/soc/qcom/smp2p_sleepstate.c
index 34b46d25a823..2ef25e48ce50 100644
--- a/drivers/soc/qcom/smp2p_sleepstate.c
+++ b/drivers/soc/qcom/smp2p_sleepstate.c
@@ -14,6 +14,8 @@
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/suspend.h>
+#include <linux/delay.h>
+#include <linux/ipc_router.h>
#include "smp2p_private.h"
#define SET_DELAY (2 * HZ)
@@ -35,10 +37,14 @@ static int sleepstate_pm_notifier(struct notifier_block *nb,
switch (event) {
case PM_SUSPEND_PREPARE:
gpio_set_value(slst_gpio_base_id + PROC_AWAKE_ID, 0);
+ msleep(25); /* To be tuned based on SMP2P latencies */
+ msm_ipc_router_set_ws_allowed(true);
break;
case PM_POST_SUSPEND:
gpio_set_value(slst_gpio_base_id + PROC_AWAKE_ID, 1);
+ msleep(25); /* To be tuned based on SMP2P latencies */
+ msm_ipc_router_set_ws_allowed(false);
break;
}
return NOTIFY_DONE;