devfreq: update target frequency in cdspl3 governor start

Trigger an update devfreq to reflect the desired target frequency
when cdspl3 governor is selected for a device. This is to avoid
running with a target frequency set by a different governor before
 cdspl3 governor gets L3 frequency request from CDSP.

Change-Id: Id5bf006d9d0584c7df93b01e47f4ccc5167fe8aa
Acked-by: Sreekanth Gande <sgande@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
This commit is contained in:
Tharun Kumar Merugu
2019-05-16 16:59:24 +05:30
committed by Gerrit - the friendly Code Review server
parent a7d847f5c2
commit 67b818fcd7

View File

@@ -54,18 +54,28 @@ static int devfreq_get_target_freq(struct devfreq *df,
static int gov_start(struct devfreq *df)
{
int ret = 0;
if (p_me.of_node != df->dev.parent->of_node) {
dev_err(df->dev.parent,
"Device match error in CDSP L3 frequency governor\n");
return -ENODEV;
}
p_me.df = df;
p_me.l3_freq_hz = 0;
/*
* Trigger an update to set the target frequency
*/
mutex_lock(&df->lock);
ret = update_devfreq(df);
mutex_unlock(&df->lock);
/*
* Send governor start message to CDSP RM driver
*/
cdsprm_register_cdspl3gov(&cdsprm);
return 0;
return ret;
}
static int gov_stop(struct devfreq *df)