Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fb87c36 authored by Ramakrishnan Ganesh's avatar Ramakrishnan Ganesh
Browse files

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: default avatarRamakrishnan Ganesh <ramakris@codeaurora.org>
parent 17ca958b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;