Skip to content

Commit

Permalink
cpufreq: cpufreq-dt: Improve debug about matching OPP
Browse files Browse the repository at this point in the history
During test of new DT OPPs it's very helpful to print the matching
OPP in case of frequency change. So it will be easier to find frequency
rounding issues in the dts file.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Stefan Wahren authored and Rafael J. Wysocki committed Nov 6, 2014
1 parent a0a22cf commit 0a1e879
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/cpufreq/cpufreq-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ static int set_target(struct cpufreq_policy *policy, unsigned int index)
old_freq = clk_get_rate(cpu_clk) / 1000;

if (!IS_ERR(cpu_reg)) {
unsigned long opp_freq;

rcu_read_lock();
opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
if (IS_ERR(opp)) {
Expand All @@ -67,9 +69,12 @@ static int set_target(struct cpufreq_policy *policy, unsigned int index)
return PTR_ERR(opp);
}
volt = dev_pm_opp_get_voltage(opp);
opp_freq = dev_pm_opp_get_freq(opp);
rcu_read_unlock();
tol = volt * priv->voltage_tolerance / 100;
volt_old = regulator_get_voltage(cpu_reg);
dev_dbg(cpu_dev, "Found OPP: %ld kHz, %ld uV\n",
opp_freq / 1000, volt);
}

dev_dbg(cpu_dev, "%u MHz, %ld mV --> %u MHz, %ld mV\n",
Expand Down

0 comments on commit 0a1e879

Please sign in to comment.