net: cnss: refactor PM QoS request wrapper API

Make PM QoS request API generic to pass the type of latency
requirement needed by the client instead of hard coding
latency type. Add latency type as a function parameter.

CRs-Fixed: 972761
Change-Id: Ic912148d2068fe8a758b6a4b3be570ccf870f03a
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
This commit is contained in:
Sarada Prasanna Garnayak 2016-02-15 18:50:40 +05:30 committed by David Keitel
parent f6b4ea8dca
commit 2456b24f24
3 changed files with 22 additions and 0 deletions

View file

@ -2867,6 +2867,17 @@ static void __exit cnss_exit(void)
platform_driver_unregister(&cnss_driver);
}
void cnss_request_pm_qos_type(int latency_type, u32 qos_val)
{
if (!penv) {
pr_err("%s: penv is NULL!\n", __func__);
return;
}
pm_qos_add_request(&penv->qos_request, latency_type, qos_val);
}
EXPORT_SYMBOL(cnss_request_pm_qos_type);
void cnss_request_pm_qos(u32 qos_val)
{
if (!penv) {

View file

@ -143,6 +143,16 @@ int cnss_request_bus_bandwidth(int bandwidth)
}
EXPORT_SYMBOL(cnss_request_bus_bandwidth);
void cnss_request_pm_qos_type(int latency_type, u32 qos_val)
{
if (!cnss_pdata)
return;
pr_debug("%s: PM QoS value: %d\n", __func__, qos_val);
pm_qos_add_request(&cnss_pdata->qos_request, latency_type, qos_val);
}
EXPORT_SYMBOL(cnss_request_pm_qos_type);
void cnss_request_pm_qos(u32 qos_val)
{
if (!cnss_pdata)

View file

@ -137,6 +137,7 @@ extern int cnss_wlan_pm_control(bool vote);
extern void cnss_lock_pm_sem(void);
extern void cnss_release_pm_sem(void);
extern void cnss_request_pm_qos_type(int latency_type, u32 qos_val);
extern void cnss_request_pm_qos(u32 qos_val);
extern void cnss_remove_pm_qos(void);
extern int cnss_get_platform_cap(struct cnss_platform_cap *cap);