diff mbox

[V2,1/2] cpufreq: cpufreq-dt: Improve debug about matching OPP

Message ID 1413583789-24294-2-git-send-email-stefan.wahren@i2se.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Stefan Wahren Oct. 17, 2014, 10:09 p.m. UTC
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>
---
 drivers/cpufreq/cpufreq-dt.c |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 6bbb8b9..959d40d 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -57,6 +57,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)) {
@@ -66,9 +68,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",