From 4d9b0808dab82179ce1bba87e5e4a9e0f66bba0d Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Wed, 20 Jul 2016 10:10:35 -0700 Subject: [PATCH] qcacmn: Add htc_pm_runtime put/get apis htc_runtime_pm apis are needed to deprecate the qdf_runtime_pm apis. The qdf_runtime_pm apis rely on cds_get_context which is not being converged and thus qdf_runtime_pm needs to be deprecated. Since the htc_handle wraps the hif context for most upper layers, htc_module is providing a wrapper functions. Change-Id: Ic66a0891db53b610fd4373e7528a08f2787f45fc CRs-Fixed: 1044150 --- htc/htc.c | 18 ++++++++++++++++++ htc/htc_api.h | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/htc/htc.c b/htc/htc.c index 5fd24fb9d8..7fddef41be 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -992,3 +992,21 @@ bool htc_can_suspend_link(HTC_HANDLE htc_handle) return hif_can_suspend_link(target->hif_dev); } + +#ifdef FEATURE_RUNTIME_PM +int htc_pm_runtime_get(HTC_HANDLE htc_handle) +{ + HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); + + HTC_INFO("%s: %pS\n", __func__, (void *)_RET_IP_); + return hif_pm_runtime_get(target->hif_dev); +} + +int htc_pm_runtime_put(HTC_HANDLE htc_handle) +{ + HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); + + HTC_INFO("%s: %pS\n", __func__, (void *)_RET_IP_); + return hif_pm_runtime_put(target->hif_dev); +} +#endif diff --git a/htc/htc_api.h b/htc/htc_api.h index 4768c0aac6..5adc278bf8 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -750,4 +750,11 @@ void htc_dump_bundle_stats(HTC_HANDLE HTCHandle); void htc_clear_bundle_stats(HTC_HANDLE HTCHandle); #endif +#ifdef FEATURE_RUNTIME_PM +int htc_pm_runtime_get(HTC_HANDLE htc_handle); +int htc_pm_runtime_put(HTC_HANDLE htc_handle); +#else +static inline int htc_pm_runtime_get(HTC_HANDLE htc_handle) { return 0; } +static inline int htc_pm_runtime_put(HTC_HANDLE htc_handle) { return 0; } +#endif #endif /* _HTC_API_H_ */