Skip to content

Commit d48461b

Browse files
Markus Mayervireshk
authored andcommitted
cpufreq: brcmstb-avs-cpufreq: send S2_ENTER / S2_EXIT commands to AVS
On suspend we send AVS_CMD_S2_ENTER and on resume AVS_CMD_S2_EXIT. These are best effort calls, so we don't check the return code or take any action if either of the calls fails. Signed-off-by: Markus Mayer <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 08535cc commit d48461b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/cpufreq/brcmstb-avs-cpufreq.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,24 @@ static int brcm_avs_suspend(struct cpufreq_policy *policy)
506506
* AVS co-processor, not necessarily the P-state we are running at now.
507507
* So, we get the current P-state explicitly.
508508
*/
509-
return brcm_avs_get_pstate(priv, &priv->pmap.state);
509+
ret = brcm_avs_get_pstate(priv, &priv->pmap.state);
510+
if (ret)
511+
return ret;
512+
513+
/* This is best effort. Nothing to do if it fails. */
514+
(void)__issue_avs_command(priv, AVS_CMD_S2_ENTER, 0, 0, NULL);
515+
516+
return 0;
510517
}
511518

512519
static int brcm_avs_resume(struct cpufreq_policy *policy)
513520
{
514521
struct private_data *priv = policy->driver_data;
515522
int ret;
516523

524+
/* This is best effort. Nothing to do if it fails. */
525+
(void)__issue_avs_command(priv, AVS_CMD_S2_EXIT, 0, 0, NULL);
526+
517527
ret = brcm_avs_set_pmap(priv, &priv->pmap);
518528
if (ret == -EEXIST) {
519529
struct platform_device *pdev = cpufreq_get_driver_data();

0 commit comments

Comments
 (0)