[PATCH 05/26][SRU][U/OEM-5.10] UBUNTU: SAUCE: ath11k: hook mhi suspend and resume
You-Sheng Yang
vicamo.yang at canonical.com
Fri Dec 4 15:19:51 UTC 2020
From: Carl Huang <cjhuang at codeaurora.org>
BugLink: https://bugs.launchpad.net/bugs/1879633
MHI suspend and resume isn't hooked in ath11k yet, so hook these
functions. Host also exposes functions for hif layer to call.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Signed-off-by: Carl Huang <cjhuang at codeaurora.org>
Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
(cherry picked from commit 762fe5bc2dd1e43ef307a375861b1a8c414b14e3
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git)
Signed-off-by: You-Sheng Yang <vicamo.yang at canonical.com>
---
drivers/net/wireless/ath/ath11k/mhi.c | 17 +++++++++++++++++
drivers/net/wireless/ath/ath11k/mhi.h | 4 ++++
2 files changed, 21 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
index 80d7dd18034d..1e5525e37d58 100644
--- a/drivers/net/wireless/ath/ath11k/mhi.c
+++ b/drivers/net/wireless/ath/ath11k/mhi.c
@@ -420,8 +420,10 @@ static int ath11k_mhi_set_state(struct ath11k_pci *ab_pci,
ret = 0;
break;
case ATH11K_MHI_SUSPEND:
+ ret = mhi_pm_suspend(ab_pci->mhi_ctrl);
break;
case ATH11K_MHI_RESUME:
+ ret = mhi_pm_resume(ab_pci->mhi_ctrl);
break;
case ATH11K_MHI_TRIGGER_RDDM:
ret = mhi_force_rddm_mode(ab_pci->mhi_ctrl);
@@ -472,3 +474,18 @@ void ath11k_mhi_stop(struct ath11k_pci *ab_pci)
ath11k_mhi_set_state(ab_pci, ATH11K_MHI_DEINIT);
}
+void ath11k_mhi_suspend(struct ath11k_pci *ab_pci)
+{
+ ath11k_mhi_set_state(ab_pci, ATH11K_MHI_SUSPEND);
+}
+
+void ath11k_mhi_resume(struct ath11k_pci *ab_pci)
+{
+ ath11k_mhi_set_state(ab_pci, ATH11K_MHI_RESUME);
+}
+
+void ath11k_mhi_force_rddm(struct ath11k_pci *ab_pci)
+{
+ ath11k_mhi_set_state(ab_pci, ATH11K_MHI_TRIGGER_RDDM);
+}
+
diff --git a/drivers/net/wireless/ath/ath11k/mhi.h b/drivers/net/wireless/ath/ath11k/mhi.h
index a7fd5e201d18..59fa920ddb53 100644
--- a/drivers/net/wireless/ath/ath11k/mhi.h
+++ b/drivers/net/wireless/ath/ath11k/mhi.h
@@ -36,4 +36,8 @@ void ath11k_mhi_unregister(struct ath11k_pci *ar_pci);
void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab);
void ath11k_mhi_clear_vector(struct ath11k_base *ab);
+void ath11k_mhi_suspend(struct ath11k_pci *ar_pci);
+void ath11k_mhi_resume(struct ath11k_pci *ar_pci);
+void ath11k_mhi_force_rddm(struct ath11k_pci *ar_pci);
+
#endif
--
2.29.2
More information about the kernel-team
mailing list