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

Commit 3c223c19 authored by Markus Mayer's avatar Markus Mayer Committed by Rafael J. Wysocki
Browse files

cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend



The AVS GET_PMAP command does return a P-state along with the P-map
information. However, that P-state is the initial P-state when the
P-map was first downloaded to AVS. It is *not* the current P-state.

Therefore, we explicitly retrieve the P-state using the GET_PSTATE
command.

Signed-off-by: default avatarMarkus Mayer <mmayer@broadcom.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9b02c54b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -784,8 +784,19 @@ static int brcm_avs_target_index(struct cpufreq_policy *policy,
static int brcm_avs_suspend(struct cpufreq_policy *policy)
{
	struct private_data *priv = policy->driver_data;
	int ret;

	ret = brcm_avs_get_pmap(priv, &priv->pmap);
	if (ret)
		return ret;

	return brcm_avs_get_pmap(priv, &priv->pmap);
	/*
	 * We can't use the P-state returned by brcm_avs_get_pmap(), since
	 * that's the initial P-state from when the P-map was downloaded to the
	 * AVS co-processor, not necessarily the P-state we are running at now.
	 * So, we get the current P-state explicitly.
	 */
	return brcm_avs_get_pstate(priv, &priv->pmap.state);
}

static int brcm_avs_resume(struct cpufreq_policy *policy)