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

Commit 9c1315c9 authored by Naman Padhiar's avatar Naman Padhiar
Browse files

icnss2: Export API to host driver to exit power save



Avoid sending EXIT_POWER_SAVE QMI message to FW from
kernel pm_resume callback. Send EXIT_POWER_SAVE QMI
from new exported API which will be called from Host
driver at the time of HOST_WAKEUP_FROM_SLEEP.
When FW receive EXIT_POWER_SAVE QMI, it will implicitly
consider that it also received HOST_WAKEUP_FROM_SLEEP
and send ACK for it through CE2.

Change-Id: Iba6e0d026749bbe5fb4fca5547cad4540932142f
Signed-off-by: default avatarNaman Padhiar <npadhiar@codeaurora.org>
parent 2f56f492
Loading
Loading
Loading
Loading
+20 −22
Original line number Diff line number Diff line
@@ -2743,6 +2743,26 @@ int icnss_idle_restart(struct device *dev)
}
EXPORT_SYMBOL(icnss_idle_restart);

int icnss_exit_power_save(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);
	int ret = 0;

	icnss_pr_dbg("Calling Exit Power Save\n");

	if (test_bit(ICNSS_PD_RESTART, &priv->state) ||
	    !test_bit(ICNSS_MODE_ON, &priv->state))
		return 0;

	ret = wlfw_exit_power_save_send_msg(priv);
	if (ret) {
		priv->stats.pm_resume_err++;
		return ret;
	}
	return 0;
}
EXPORT_SYMBOL(icnss_exit_power_save);

void icnss_allow_recursive_recovery(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);
@@ -3356,18 +3376,6 @@ static int icnss_pm_resume(struct device *dev)
	    !test_bit(ICNSS_DRIVER_PROBED, &priv->state))
		goto out;

	if (priv->device_id == WCN6750_DEVICE_ID) {
		if (test_bit(ICNSS_PD_RESTART, &priv->state) ||
		    !test_bit(ICNSS_MODE_ON, &priv->state))
			goto out;

		ret = wlfw_exit_power_save_send_msg(priv);
		if (ret) {
			priv->stats.pm_resume_err++;
			return ret;
		}
	}

	ret = priv->ops->pm_resume(dev);

out:
@@ -3475,16 +3483,6 @@ static int icnss_pm_runtime_resume(struct device *dev)

	icnss_pr_vdbg("Runtime resume, state: 0x%lx\n", priv->state);

	if (test_bit(ICNSS_PD_RESTART, &priv->state) ||
	    !test_bit(ICNSS_MODE_ON, &priv->state))
		goto out;

	ret = wlfw_exit_power_save_send_msg(priv);
	if (ret) {
		priv->stats.pm_resume_err++;
		return ret;
	}

	ret = priv->ops->runtime_resume(dev);

out:
+1 −0
Original line number Diff line number Diff line
@@ -190,4 +190,5 @@ extern void icnss_thermal_cdev_unregister(struct device *dev, int tcdev_id);
extern int icnss_get_curr_therm_cdev_state(struct device *dev,
					    unsigned long *thermal_state,
					    int tcdev_id);
extern int icnss_exit_power_save(struct device *dev);
#endif /* _ICNSS_WLAN_H_ */