OSDN Git Service

ath11k: mhi: hook suspend and resume
authorCarl Huang <cjhuang@codeaurora.org>
Fri, 11 Dec 2020 17:35:41 +0000 (19:35 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 12 Dec 2020 04:41:16 +0000 (06:41 +0200)
MHI suspend and resume isn't hooked in ath11k yet, so hook these
functions needed for suspend support.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1607708150-21066-2-git-send-email-kvalo@codeaurora.org
drivers/net/wireless/ath/ath11k/mhi.c
drivers/net/wireless/ath/ath11k/mhi.h

index 74f9956..09858e5 100644 (file)
@@ -419,8 +419,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);
@@ -471,3 +473,12 @@ 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);
+}
index a7fd5e2..488dada 100644 (file)
@@ -36,4 +36,7 @@ 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);
+
 #endif