瀏覽代碼

qcacld-3.0: add Runtime PM support and its PLD callbacks

Add PLD functions for Runtime suspend and resume callbacks,
and enable Runtime PM support for Moselle.

Change-Id: Ie990334c0c60892ec0f0ad6fac3253b3d326a919
CRs-Fixed: 2720832
Vevek Venkatesan 5 年之前
父節點
當前提交
7d7f50849d
共有 2 個文件被更改,包括 53 次插入0 次删除
  1. 4 0
      configs/default_defconfig
  2. 49 0
      core/pld/src/pld_ipci.c

+ 4 - 0
configs/default_defconfig

@@ -486,6 +486,10 @@ ifeq ($(CONFIG_CNSS_QCA6750), y)
 	CONFIG_FEATURE_HAL_DELAYED_REG_WRITE := n
 endif
 
+ifeq ($(CONFIG_CNSS_QCA6750), y)
+	CONFIG_BUS_AUTO_SUSPEND := y
+endif
+
 CONFIG_QCA_WIFI_QCA8074 := y
 CONFIG_QCA_WIFI_QCA8074_VP := y
 CONFIG_DP_INTR_POLL_BASED := y

+ 49 - 0
core/pld/src/pld_ipci.c

@@ -240,6 +240,53 @@ static int pld_ipci_resume_noirq(struct device *dev)
 	return 0;
 }
 
+/**
+ * pld_ipci_runtime_suspend() - Runtime suspend callback for power management
+ * @dev: device
+ *
+ * This function is to runtime suspend the platform device when power management
+ * is enabled.
+ *
+ * Return: status
+ */
+static int pld_ipci_runtime_suspend(struct device *dev)
+{
+	struct pld_context *pld_context;
+
+	pld_context = pld_get_global_context();
+	if (!pld_context)
+		return -EINVAL;
+
+	if (pld_context->ops && pld_context->ops->runtime_suspend)
+		return pld_context->ops->runtime_suspend(dev,
+							 PLD_BUS_TYPE_IPCI);
+
+	return 0;
+}
+
+/**
+ * pld_ipci_runtime_resume() - Runtime resume callback for power management
+ * @pdev: device
+ *
+ * This function is to runtime resume the platform device when power management
+ * is enabled.
+ *
+ * Return: status
+ */
+static int pld_ipci_runtime_resume(struct device *dev)
+{
+	struct pld_context *pld_context;
+
+	pld_context = pld_get_global_context();
+	if (!pld_context)
+		return -EINVAL;
+
+	if (pld_context->ops && pld_context->ops->runtime_resume)
+		return pld_context->ops->runtime_resume(dev, PLD_BUS_TYPE_IPCI);
+
+	return 0;
+}
+
 static int pld_ipci_uevent(struct device *dev,
 			   struct icnss_uevent_data *uevent)
 {
@@ -343,6 +390,8 @@ struct icnss_driver_ops pld_ipci_ops = {
 	.pm_resume  = pld_ipci_pm_resume,
 	.suspend_noirq = pld_ipci_suspend_noirq,
 	.resume_noirq = pld_ipci_resume_noirq,
+	.runtime_suspend = pld_ipci_runtime_suspend,
+	.runtime_resume  = pld_ipci_runtime_resume,
 	.uevent = pld_ipci_uevent,
 	.idle_restart = pld_ipci_idle_restart_cb,
 	.idle_shutdown = pld_ipci_idle_shutdown_cb,