summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-09-10 20:09:29 +0300
committerEduardo Valentin <edubezval@gmail.com>2015-10-30 20:19:42 +0300
commitd6d007429f21626ad0f9cf96589151e0746f5648 (patch)
treedfe1fdf119ab1ecb61df53e62ed270bd13fa0a73 /drivers/base
parentb840b6e65cbe2b84ec398bb286d121a9eb2597ee (diff)
downloadlinux-d6d007429f21626ad0f9cf96589151e0746f5648.tar.xz
PM / OPP: get the voltage for all OPPs
The OPP library is now used for power models to calculate the power that a device would consume at a specific OPP. To do that, we use a simple power model which takes frequency and voltage as inputs. We get the voltage and frequency from the OPP library. The devfreq cooling device for the thermal framework controls temperature by disabling OPPs. The power model needs to calculate the power that would be consumed if we reenabled the OPP. Therefore, let dev_pm_opp_get_voltage() work for disabled OPPs. Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/opp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 28cd75c535b0..586e60030c63 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -217,7 +217,7 @@ static struct device_opp *_find_device_opp(struct device *dev)
}
/**
- * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an available opp
+ * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp
* @opp: opp for which voltage has to be returned for
*
* Return: voltage in micro volt corresponding to the opp, else
@@ -239,7 +239,7 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
opp_rcu_lockdep_assert();
tmp_opp = rcu_dereference(opp);
- if (IS_ERR_OR_NULL(tmp_opp) || !tmp_opp->available)
+ if (IS_ERR_OR_NULL(tmp_opp))
pr_err("%s: Invalid parameters\n", __func__);
else
v = tmp_opp->u_volt;