aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/opp/of.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2018-06-14 10:03:26 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2018-11-05 07:40:43 +0530
commitca1b5d77b1c69df7d7b92860c61daa82c8bfde34 (patch)
treecf9e7c140a601d1ea0b79a5ee89b56ca84914f40 /drivers/opp/of.c
parentOPP: Add dev_pm_opp_{set|put}_genpd_virt_dev() helper (diff)
downloadlinux-dev-ca1b5d77b1c69df7d7b92860c61daa82c8bfde34.tar.xz
linux-dev-ca1b5d77b1c69df7d7b92860c61daa82c8bfde34.zip
OPP: Configure all required OPPs
Now that all the infrastructure is in place to support multiple required OPPs, lets switch over to using it. A new internal routine _set_required_opps() takes care of updating performance state for all the required OPPs. With this the performance state updates are supported even when the end device needs to configure regulators as well, that wasn't the case earlier. The pstates were earlier stored in the end device's OPP structures, that also changes now as those values are stored in the genpd's OPP structures. And so we switch over to using pm_genpd_opp_to_performance_state() instead of of_genpd_opp_to_performance_state() to get performance state for the genpd OPPs. The routine _generic_set_opp_domain() is not required anymore and is removed. On errors we don't try to recover by reverting to old settings as things are really complex now and the calls here should never really fail unless there is a bug. There is no point increasing the complexity, for code which will never be executed. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp/of.c')
-rw-r--r--drivers/opp/of.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 71aef28953c2..4e494720ac25 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -595,12 +595,13 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
if (!of_property_read_u32(np, "clock-latency-ns", &val))
new_opp->clock_latency_ns = val;
- new_opp->pstate = of_genpd_opp_to_performance_state(dev, np);
-
ret = opp_parse_supplies(new_opp, dev, opp_table);
if (ret)
goto free_required_opps;
+ if (opp_table->is_genpd)
+ new_opp->pstate = pm_genpd_opp_to_performance_state(dev, new_opp);
+
ret = _opp_add(dev, new_opp, opp_table, rate_not_available);
if (ret) {
/* Don't return error for duplicate OPPs */