Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73f10ef5 authored by Yuanyuan Liu's avatar Yuanyuan Liu Committed by Yue Ma
Browse files

cnss: Add PCIe power control support



Export a PCIe power control API to WLAN host driver who will decide
which suspend mode (D3 or D0 mode) it will enter based on the number
of connected clients and then call this API to vote PCIe link down/up
accordingly.

CRs-Fixed: 685771
Change-Id: Ib44938b94ba07a1b220615e9f1febcafca8f4277
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent ff1ff8e0
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1057,6 +1057,20 @@ void cnss_pm_wake_lock_destroy(struct wakeup_source *ws)
}
EXPORT_SYMBOL(cnss_pm_wake_lock_destroy);

#ifdef CONFIG_PCI_MSM
int cnss_wlan_pm_control(bool vote)
{
	if (!penv || !penv->pdev)
		return -ENODEV;

	return msm_pcie_pm_control(
		vote ? MSM_PCIE_DISABLE_PC : MSM_PCIE_ENABLE_PC,
		cnss_get_pci_dev_bus_number(penv->pdev),
		penv->pdev, NULL, PM_OPTIONS);
}
EXPORT_SYMBOL(cnss_wlan_pm_control);
#endif

void cnss_flush_work(void *work)
{
	struct work_struct *cnss_work = work;
+3 −0
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ extern void cnss_pm_wake_lock(struct wakeup_source *ws);
extern void cnss_pm_wake_lock_timeout(struct wakeup_source *ws, ulong msec);
extern void cnss_pm_wake_lock_release(struct wakeup_source *ws);
extern void cnss_pm_wake_lock_destroy(struct wakeup_source *ws);
#ifdef CONFIG_PCI_MSM
extern int cnss_wlan_pm_control(bool vote);
#endif

extern int cnss_set_cpus_allowed_ptr(struct task_struct *task, ulong cpu);
extern void cnss_request_pm_qos(u32 qos_val);