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

Commit 7a316e9a authored by Komal Seelam's avatar Komal Seelam
Browse files

cnss: Toggle PCIe EP WLAN_EN on dual-wifi platforms



On support of sdio runtime enumeration, allow toggling pcie ep wlan_en.
This helps save power on dual-wifi attachments.

CRs-Fixed: 1046397
Change-Id: Id94e6a3e8a883d46cb898c8d7c32b616b995c828
Signed-off-by: default avatarKomal Seelam <kseelam@codeaurora.org>
parent d5fa91ad
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -502,11 +502,6 @@ static int cnss_wlan_enable_pin_set_state(
{
	int ret;

	if (!state && penv->dual_wifi_info.is_dual_wifi_enabled) {
		pr_debug("%s:Dual WiFi enabled, skip sleep state\n", __func__);
		return 0;
	}

	if (state)
		goto set_wlan_pin_active;

@@ -2307,10 +2302,8 @@ again:

		ret = wdrv->probe(pdev, penv->id);
		if (ret) {
			if (!penv->dual_wifi_info.is_dual_wifi_enabled) {
			wcnss_prealloc_check_memory_leak();
			wcnss_pre_alloc_reset();
			}

			if (probe_again > 3) {
				pr_err("Failed to probe WLAN\n");
@@ -2400,10 +2393,8 @@ void cnss_wlan_unregister_driver(struct cnss_wlan_driver *driver)
	if (wdrv->remove)
		wdrv->remove(pdev);

	if (!penv->dual_wifi_info.is_dual_wifi_enabled) {
	wcnss_prealloc_check_memory_leak();
	wcnss_pre_alloc_reset();
	}

	cnss_msm_pcie_deregister_event(&penv->event_reg);

+7 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ static int cnss_put_hw_resources(struct device *dev)

	if (!host) {
		pr_err("%s: MMC host is invalid\n", __func__);
		return 0;
		return ret;
	}

	ret = mmc_power_save_host(host);
@@ -276,6 +276,12 @@ static int cnss_get_hw_resources(struct device *dev)

	host = info->host;

	if (!host) {
		pr_err("%s: MMC Host is Invalid; Enumeration Failed\n",
		       __func__);
		return ret;
	}

	ret = regulator_enable(cnss_pdata->regulator.wlan_vreg);
	if (ret) {
		pr_err("%s: Failed to enable wlan vreg\n", __func__);