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

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

cnss2: Use proper way to enable FW waltest



Currently CNSS driver enables FW waltest by avoiding calling host
driver probe during host driver loading. If host driver loading
waits for probe to complete, this method won't work. Enable FW
waltest using proper way by sending QMI waltest mode request to FW.

Change-Id: I9ca8d7cbc4479a57b775dd54a2fcf61036f44799
CRs-fixed: 2024543
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent 0987ef99
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -468,6 +468,9 @@ static int cnss_fw_ready_hdlr(struct cnss_plat_data *plat_priv)

	if (test_bit(CNSS_DRIVER_LOAD_UNLOAD, &plat_priv->driver_state))
		complete(&plat_priv->fw_ready_event);
	else if (enable_waltest)
		ret = cnss_wlfw_wlan_mode_send_sync(plat_priv,
						    QMI_WLFW_WALTEST_V01);
	else
		ret = cnss_wlfw_wlan_mode_send_sync(plat_priv,
						    QMI_WLFW_CALIBRATION_V01);
@@ -1059,12 +1062,6 @@ static int cnss_qca6290_powerup(struct cnss_plat_data *plat_priv)
	}

skip_fw_ready:
	if (enable_waltest) {
		cnss_pr_dbg("Firmware waltest is enabled.\n");
		ret = 0;
		goto out;
	}

	if (test_bit(CNSS_DRIVER_LOAD_UNLOAD, &plat_priv->driver_state)) {
		ret = plat_priv->driver_ops->probe(pci_priv->pci_dev,
						   pci_priv->pci_device_id);
@@ -1113,9 +1110,6 @@ static int cnss_qca6290_shutdown(struct cnss_plat_data *plat_priv)
	if (!plat_priv->driver_ops)
		return -EINVAL;

	if (enable_waltest)
		goto bypass_driver_remove;

	if (test_bit(CNSS_DRIVER_LOAD_UNLOAD, &plat_priv->driver_state)) {
		cnss_request_bus_bandwidth(CNSS_BUS_WIDTH_NONE);
		plat_priv->driver_ops->remove(pci_priv->pci_dev);
@@ -1126,7 +1120,6 @@ static int cnss_qca6290_shutdown(struct cnss_plat_data *plat_priv)
		plat_priv->driver_ops->shutdown(pci_priv->pci_dev);
	}

bypass_driver_remove:
	cnss_pci_stop_mhi(pci_priv);

	ret = cnss_suspend_pci_link(pci_priv);