summaryrefslogtreecommitdiff
path: root/core/pld/src/pld_snoc.c
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2016-08-29 12:17:20 -0700
committerYuanyuan Liu <yuanliu@codeaurora.org>2016-09-08 17:43:46 -0700
commit42567dfb229d9ebfd7bef0877f682fc61e7973f0 (patch)
treef25143c32671250dbc6f105c910c466a746f0aed /core/pld/src/pld_snoc.c
parentb657e93ec556223c1d9e07b983a6264f9177b606 (diff)
downloadqcacld-42567dfb229d9ebfd7bef0877f682fc61e7973f0.tar.gz
qcacld-3.0: Register suspend_noirq/resume_noirq to kernel
Register suspend_noirq/resume_noirq callbacks to kernel. It will make sure no wake up is pending from FW and if initial wake up is received then failing it should trigger resume. Change-Id: I3d3de3789a7d560ed171294fa9a1ebe6389746a7 CRs-Fixed: 1060669
Diffstat (limited to 'core/pld/src/pld_snoc.c')
-rw-r--r--core/pld/src/pld_snoc.c69
1 files changed, 62 insertions, 7 deletions
diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c
index bfbedb056c..a47409b418 100644
--- a/core/pld/src/pld_snoc.c
+++ b/core/pld/src/pld_snoc.c
@@ -148,25 +148,26 @@ static void pld_snoc_crash_shutdown(void *dev)
}
/**
- * pld_snoc_suspend() - Suspend callback function for power management
+ * pld_snoc_pm_suspend() - PM suspend callback function for power management
* @dev: device
- * @state: power state
*
* This function is to suspend the platform device when power management
* is enabled.
*
* Return: void
*/
-static int pld_snoc_suspend(struct device *dev, pm_message_t state)
+static int pld_snoc_pm_suspend(struct device *dev)
{
struct pld_context *pld_context;
+ pm_message_t state;
+ state.event = PM_EVENT_SUSPEND;
pld_context = pld_get_global_context();
return pld_context->ops->suspend(dev, PLD_BUS_TYPE_SNOC, state);
}
/**
- * pld_snoc_resume() - Resume callback function for power management
+ * pld_snoc_pm_resume() - PM resume callback function for power management
* @pdev: device
*
* This function is to resume the platform device when power management
@@ -174,7 +175,7 @@ static int pld_snoc_suspend(struct device *dev, pm_message_t state)
*
* Return: void
*/
-static int pld_snoc_resume(struct device *dev)
+static int pld_snoc_pm_resume(struct device *dev)
{
struct pld_context *pld_context;
@@ -182,6 +183,58 @@ static int pld_snoc_resume(struct device *dev)
return pld_context->ops->resume(dev, PLD_BUS_TYPE_SNOC);
}
+/**
+ * pld_snoc_suspend_noirq() - Complete the actions started by suspend()
+ * @dev: device
+ *
+ * Complete the actions started by suspend(). Carry out any
+ * additional operations required for suspending the device that might be
+ * racing with its driver's interrupt handler, which is guaranteed not to
+ * run while suspend_noirq() is being executed.
+ *
+ * Return: 0 for success
+ * Non zero failure code for errors
+ */
+static int pld_snoc_suspend_noirq(struct device *dev)
+{
+ struct pld_context *pld_context;
+
+ pld_context = pld_get_global_context();
+ if (!pld_context)
+ return -EINVAL;
+
+ if (pld_context->ops->suspend_noirq)
+ return pld_context->ops->
+ suspend_noirq(dev, PLD_BUS_TYPE_SNOC);
+ return 0;
+}
+
+/**
+ * pld_snoc_resume_noirq() - Prepare for the execution of resume()
+ * @pdev: device
+ *
+ * Prepare for the execution of resume() by carrying out any
+ * operations required for resuming the device that might be racing with
+ * its driver's interrupt handler, which is guaranteed not to run while
+ * resume_noirq() is being executed.
+ *
+ * Return: 0 for success
+ * Non zero failure code for errors
+ */
+static int pld_snoc_resume_noirq(struct device *dev)
+{
+ struct pld_context *pld_context;
+
+ pld_context = pld_get_global_context();
+ if (!pld_context)
+ return -EINVAL;
+
+ if (pld_context->ops->resume_noirq)
+ return pld_context->ops->
+ resume_noirq(dev, PLD_BUS_TYPE_SNOC);
+ return 0;
+}
+
struct icnss_driver_ops pld_snoc_ops = {
.name = "pld_snoc",
.probe = pld_snoc_probe,
@@ -189,8 +242,10 @@ struct icnss_driver_ops pld_snoc_ops = {
.shutdown = pld_snoc_shutdown,
.reinit = pld_snoc_reinit,
.crash_shutdown = pld_snoc_crash_shutdown,
- .suspend = pld_snoc_suspend,
- .resume = pld_snoc_resume,
+ .pm_suspend = pld_snoc_pm_suspend,
+ .pm_resume = pld_snoc_pm_resume,
+ .suspend_noirq = pld_snoc_suspend_noirq,
+ .resume_noirq = pld_snoc_resume_noirq,
};
/**