Browse Source

qcacld-3.0: Provide hif runtime suspend resume apis

hif runtime suspend resume is identical to a regular bus suspend
resume, but provide a different api just in case this changes.

Change-Id: If069df7733d6a1ebe38d356ac5bdd4e2a250118b
CRs-Fixed: 935300
Houston Hoffman 9 years ago
parent
commit
1688fba972
3 changed files with 47 additions and 3 deletions
  1. 2 0
      core/hif/inc/hif.h
  2. 25 3
      core/hif/src/pcie/if_pci.c
  3. 20 0
      core/hif/src/snoc/if_snoc.c

+ 2 - 0
core/hif/inc/hif.h

@@ -684,6 +684,8 @@ void hif_runtime_pm_set_state_inprogress(void);
 void hif_runtime_pm_set_state_on(void);
 
 void hif_enable_power_management(void *hif_ctx);
+int hif_runtime_suspend(void);
+int hif_runtime_resume(void);
 int hif_bus_resume(void);
 int hif_bus_suspend(void);
 void hif_vote_link_down(void);

+ 25 - 3
core/hif/src/pcie/if_pci.c

@@ -1797,9 +1797,10 @@ static int hif_bus_resume_link_down(void)
 
 /**
  * hif_bus_suspend(): prepare hif for suspend
+ *
  * chose suspend type based on link suspend voting.
  *
- * Return: linux status
+ * Return: 0 for success and non-zero error code for failure
  */
 int hif_bus_suspend(void)
 {
@@ -1810,10 +1811,11 @@ int hif_bus_suspend(void)
 }
 
 /**
- * hif_bus_suspend(): prepare hif for suspend
+ * hif_bus_resume(): prepare hif for resume
+ *
  * chose suspend type based on link suspend voting.
  *
- * Return: linux status
+ * Return: 0 for success and non-zero error code for failure
  */
 int hif_bus_resume(void)
 {
@@ -1881,6 +1883,26 @@ void hif_runtime_pm_set_state_suspended(void)
 	__hif_runtime_pm_set_state(HIF_PM_RUNTIME_STATE_SUSPENDED);
 }
 
+/**
+ * hif_runtime_suspend() - do the bus suspend part of a runtime suspend
+ *
+ * Return: 0 for success and non-zero error code for failure
+ */
+int hif_runtime_suspend(void)
+{
+	return hif_bus_suspend();
+}
+
+/**
+ * hif_runtime_resume() - do the bus resume part of a runtime resume
+ *
+ *  Return: 0 for success and non-zero error code for failure
+ */
+int hif_runtime_resume(void)
+{
+	return hif_bus_resume();
+}
+
 void hif_disable_isr(void *ol_sc)
 {
 	struct ol_softc *scn = (struct ol_softc *)ol_sc;

+ 20 - 0
core/hif/src/snoc/if_snoc.c

@@ -141,6 +141,15 @@ void hif_runtime_pm_set_state_on(void)
 {
 }
 
+/**
+ * hif_runtime_pm_set_state_suspended() - dummy function
+ *
+ * currently runtime pm only supported in pci
+ */
+void hif_runtime_pm_set_state_suspended(void)
+{
+}
+
 /**
  * hif_bus_suspend() - suspend the bus
  *
@@ -167,6 +176,17 @@ int hif_bus_resume(void)
 	return 0;
 }
 
+static int hif_runtime_suspend(void)
+{
+	return hif_bus_suspend();
+}
+
+static int hif_runtime_resume(void)
+{
+	return hif_bus_resume();
+}
+
+
 /**
  * hif_enable_power_gating(): enable HW power gating
  *