aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-09-02 14:36:50 +0530
committerAlex Shi <alex.shi@linaro.org>2015-11-02 11:11:11 +0800
commit32f33efff0ecba240db5b13a54fcd863eb577515 (patch)
treed5539d22c53ce39ffff1f1b34420d1b410461625
parent805fe882b2e78532d4202d74d4e7314c0ba6ee42 (diff)
cpufreq: dt: Tolerance applies on both sides of target voltage
Tolerance applies on both sides of the target voltage, i.e. both min and max sides. But while checking if a voltage is supported by the regulator or not, we haven't taken care of tolerance on the lower side. Fix that. Cc: Lucas Stach <l.stach@pengutronix.de> Fixes: 045ee45c4ff2 ("cpufreq: cpufreq-dt: disable unsupported OPPs") Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit a2022001cebd0825b96aa0f3345ea3ad44ae79d4) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/cpufreq/cpufreq-dt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index b1131cf89757..3b64c203bf99 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -303,7 +303,8 @@ static int cpufreq_init(struct cpufreq_policy *policy)
rcu_read_unlock();
tol_uV = opp_uV * priv->voltage_tolerance / 100;
- if (regulator_is_supported_voltage(cpu_reg, opp_uV,
+ if (regulator_is_supported_voltage(cpu_reg,
+ opp_uV - tol_uV,
opp_uV + tol_uV)) {
if (opp_uV < min_uV)
min_uV = opp_uV;