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

Commit 2aa9912f authored by gaolez's avatar gaolez
Browse files

cnss_sdio: fix wlan card sdio rate can't reach 200M after warm start



The wlan card detected as high speed SDIO card after device
warm start while it detected as ultra high speed SDIO card
after device cold start.

Wlan card enable pin not be pulled in the sequence high/low/high
will make wlan card detected as high speed SDIO card but not ultra
high speed after warm start.

Change the wlan vdd regulator check logic for cnss_put_hw_resources
and cnss_get_hw_resources, so the function will not return directly
if there is no vdd-wlan on board.

Change-Id: I741ef1b6e8d9b950b6ebc9b2e64d16ab6d3912f0
CRs-Fixed: 2184824
Signed-off-by: default avatarGaole Zhang <gaolez@codeaurora.org>
parent 932c5930
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -278,11 +278,6 @@ static int cnss_put_hw_resources(struct device *dev)
		return ret;
	}

	if (!cnss_pdata->regulator.wlan_vreg) {
		pr_debug("wlan_vreg regulator is invalid\n");
		return 0;
	}

	ret = mmc_power_save_host(host);
	if (ret) {
		pr_err("Failed to Power Save Host err:%d\n",
@@ -290,7 +285,11 @@ static int cnss_put_hw_resources(struct device *dev)
		return ret;
	}

	if (cnss_pdata->regulator.wlan_vreg)
		regulator_disable(cnss_pdata->regulator.wlan_vreg);
	else
		pr_debug("wlan_vreg regulator is invalid\n");

	info->cnss_hw_state = CNSS_HW_SLEEP;

	return ret;
@@ -324,21 +323,22 @@ static int cnss_get_hw_resources(struct device *dev)
		return ret;
	}

	if (!cnss_pdata->regulator.wlan_vreg) {
		pr_debug("wlan_vreg regulator is invalid\n");
		return 0;
	}

	if (cnss_pdata->regulator.wlan_vreg) {
		ret = regulator_enable(cnss_pdata->regulator.wlan_vreg);
		if (ret) {
			pr_err("Failed to enable wlan vreg\n");
			return ret;
		}
	} else {
		pr_debug("wlan_vreg regulator is invalid\n");
	}


	ret = mmc_power_restore_host(host);
	if (ret) {
		pr_err("Failed to restore host power ret:%d\n",
		       ret);
		if (cnss_pdata->regulator.wlan_vreg)
			regulator_disable(cnss_pdata->regulator.wlan_vreg);
		return ret;
	}