summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq-dt.c
diff options
context:
space:
mode:
authorDietmar Eggemann <dietmar.eggemann@arm.com>2017-09-26 19:41:09 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-03 03:37:53 +0300
commit400ec74d3b3784a48b09db9518aa2c4b6d4e497f (patch)
treee01e996a57ad622e9f8f6e2743136bb8c58070d2 /drivers/cpufreq/cpufreq-dt.c
parent518accf2062971344310ee85d7fdab55e8c11337 (diff)
downloadlinux-400ec74d3b3784a48b09db9518aa2c4b6d4e497f.tar.xz
cpufreq: dt: invoke frequency-invariance setter function
Call the frequency-invariance setter function arch_set_freq_scale() if the new frequency has been successfully set which is indicated by dev_pm_opp_set_rate() returning 0. Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq-dt.c')
-rw-r--r--drivers/cpufreq/cpufreq-dt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index d83ab94d041a..545946ad0752 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -43,9 +43,17 @@ static struct freq_attr *cpufreq_dt_attr[] = {
static int set_target(struct cpufreq_policy *policy, unsigned int index)
{
struct private_data *priv = policy->driver_data;
+ unsigned long freq = policy->freq_table[index].frequency;
+ int ret;
+
+ ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
- return dev_pm_opp_set_rate(priv->cpu_dev,
- policy->freq_table[index].frequency * 1000);
+ if (!ret) {
+ arch_set_freq_scale(policy->related_cpus, freq,
+ policy->cpuinfo.max_freq);
+ }
+
+ return ret;
}
/*