qcom-cpufreq: Implement resolve_freq method
The resolve_freq method is needed for schedutil to avoid calling into cpufreq for changing to the same frequency again and again. Change-Id: Ia03cc49e3b8bad68fa2fda5688c64233b4b2c48d Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Rohit Gupta <rohgup@codeaurora.org> Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
This commit is contained in:
committed by
Jonathan Avila
parent
fa6cf98e93
commit
2d7062186f
@@ -93,6 +93,16 @@ static int msm_cpufreq_target(struct cpufreq_policy *policy,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned int msm_cpufreq_resolve_freq(struct cpufreq_policy *policy,
|
||||||
|
unsigned int target_freq)
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
|
||||||
|
index = cpufreq_frequency_table_target(policy, target_freq,
|
||||||
|
CPUFREQ_RELATION_L);
|
||||||
|
return policy->freq_table[index].frequency;
|
||||||
|
}
|
||||||
|
|
||||||
static int msm_cpufreq_verify(struct cpufreq_policy *policy)
|
static int msm_cpufreq_verify(struct cpufreq_policy *policy)
|
||||||
{
|
{
|
||||||
cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||||
@@ -278,6 +288,7 @@ static struct cpufreq_driver msm_cpufreq_driver = {
|
|||||||
.init = msm_cpufreq_init,
|
.init = msm_cpufreq_init,
|
||||||
.verify = msm_cpufreq_verify,
|
.verify = msm_cpufreq_verify,
|
||||||
.target = msm_cpufreq_target,
|
.target = msm_cpufreq_target,
|
||||||
|
.resolve_freq = msm_cpufreq_resolve_freq,
|
||||||
.get = msm_cpufreq_get_freq,
|
.get = msm_cpufreq_get_freq,
|
||||||
.name = "msm",
|
.name = "msm",
|
||||||
.attr = msm_freq_attr,
|
.attr = msm_freq_attr,
|
||||||
|
|||||||
Reference in New Issue
Block a user