From f2936d19bc7d775f3dcd2cfca6967c46fa054d89 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Tue, 10 Nov 2015 16:47:27 -0800 Subject: [PATCH] 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 --- core/hif/inc/hif.h | 2 ++ core/hif/src/pcie/if_pci.c | 28 +++++++++++++++++++++++++--- core/hif/src/snoc/if_snoc.c | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/core/hif/inc/hif.h b/core/hif/inc/hif.h index de926ef998b1..40950c31f031 100644 --- a/core/hif/inc/hif.h +++ b/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); diff --git a/core/hif/src/pcie/if_pci.c b/core/hif/src/pcie/if_pci.c index 09e06f15fa30..a70811e7e052 100644 --- a/core/hif/src/pcie/if_pci.c +++ b/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; diff --git a/core/hif/src/snoc/if_snoc.c b/core/hif/src/snoc/if_snoc.c index c5f248d8f847..c9dfa8c96d20 100644 --- a/core/hif/src/snoc/if_snoc.c +++ b/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 *