qcacmn: Move hif_pm_runtime_resume() to hif.h file

This is a public API, so move it outside to hif.h file so it can be
used elsewhere as well.

Change-Id: Ic870cf804df69f6d7bb5a792da662759d687e0ed
CRs-Fixed: 2616491
This commit is contained in:
Alan Chen
2020-02-05 11:49:45 -08:00
committed by nshrivas
parent d0708ac038
commit 6760310422
3 changed files with 29 additions and 6 deletions

View File

@@ -893,6 +893,7 @@ void hif_pm_runtime_set_monitor_wake_intr(struct hif_opaque_softc *hif_ctx,
void hif_pm_runtime_mark_dp_rx_busy(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_is_dp_rx_busy(struct hif_opaque_softc *hif_ctx);
qdf_time_t hif_pm_runtime_get_dp_rx_busy_mark(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx);
#else
struct hif_pm_runtime_lock {
const char *name;
@@ -950,6 +951,8 @@ hif_pm_runtime_is_dp_rx_busy(struct hif_opaque_softc *hif_ctx)
static inline qdf_time_t
hif_pm_runtime_get_dp_rx_busy_mark(struct hif_opaque_softc *hif_ctx)
{ return 0; }
static inline int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx)
{ return 0; }
#endif
void hif_enable_power_management(struct hif_opaque_softc *hif_ctx,

View File

@@ -1170,7 +1170,8 @@ static void hif_pm_runtime_stop(struct hif_pci_softc *sc)
return;
hif_runtime_exit(sc->dev);
hif_pm_runtime_resume(sc->dev);
hif_pm_runtime_sync_resume(GET_HIF_OPAQUE_HDL(sc));
qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE);
@@ -1277,6 +1278,29 @@ static void hif_pm_runtime_close(struct hif_pci_softc *sc)
hif_pm_runtime_sanitize_on_ssr_exit(sc) :
hif_pm_runtime_sanitize_on_exit(sc);
}
int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx)
{
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
int pm_state;
if (!sc)
return -EINVAL;
if (!pm_runtime_enabled(sc->dev))
return 0;
pm_state = qdf_atomic_read(&sc->pm_state);
if (pm_state == HIF_PM_RUNTIME_STATE_SUSPENDED ||
pm_state == HIF_PM_RUNTIME_STATE_SUSPENDING)
HIF_INFO("Runtime PM resume is requested by %ps",
(void *)_RET_IP_);
sc->pm_stats.request_resume++;
sc->pm_stats.last_resume_caller = (void *)_RET_IP_;
return pm_runtime_resume(sc->dev);
}
#else
static void hif_pm_runtime_close(struct hif_pci_softc *sc) {}
static void hif_pm_runtime_open(struct hif_pci_softc *sc) {}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -268,9 +268,5 @@ static inline int hif_pm_runtime_put_auto(struct device *dev)
return pm_runtime_put_autosuspend(dev);
}
static inline int hif_pm_runtime_resume(struct device *dev)
{
return pm_runtime_resume(dev);
}
#endif /* FEATURE_RUNTIME_PM */
#endif /* __ATH_PCI_H__ */