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

Commit e2981a48 authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Expose PCIe PM control vote API to WLAN host driver



This ensures CNSS2 platform driver is compatible with latest WLAN
host driver.

Change-Id: I224dd71c5c2ec58bf29f7e634a0f39cfd7f86fcf
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent ef6c4f46
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -456,6 +456,28 @@ static int cnss_pci_runtime_idle(struct device *dev)
	return -EBUSY;
}

int cnss_wlan_pm_control(bool vote)
{
	struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL);
	struct cnss_pci_data *pci_priv;
	struct pci_dev *pci_dev;

	if (!plat_priv)
		return -ENODEV;

	pci_priv = plat_priv->bus_priv;
	if (!pci_priv)
		return -ENODEV;

	pci_dev = pci_priv->pci_dev;

	return msm_pcie_pm_control(vote ? MSM_PCIE_DISABLE_PC :
				   MSM_PCIE_ENABLE_PC,
				   pci_dev->bus->number, pci_dev,
				   NULL, PM_OPTIONS_DEFAULT);
}
EXPORT_SYMBOL(cnss_wlan_pm_control);

int cnss_auto_suspend(void)
{
	int ret = 0;
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ extern void cnss_request_pm_qos(u32 qos_val);
extern void cnss_remove_pm_qos(void);
extern void cnss_lock_pm_sem(void);
extern void cnss_release_pm_sem(void);
extern int cnss_wlan_pm_control(bool vote);
extern int cnss_auto_suspend(void);
extern int cnss_auto_resume(void);