diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2023-06-14 11:59:32 +0200 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2023-06-19 06:20:09 +0200 |
commit | 7c41cdcd3bbee5d49de9d4821b15e49d155ff22b (patch) | |
tree | 90c682ac35d71e68606a2fbee21a385881e24b20 /drivers/opp/of.c | |
parent | OPP: pstate is only valid for genpd OPP tables (diff) | |
download | linux-7c41cdcd3bbee5d49de9d4821b15e49d155ff22b.tar.xz linux-7c41cdcd3bbee5d49de9d4821b15e49d155ff22b.zip |
OPP: Simplify the over-designed pstate <-> level dance
While adding support for "performance states" in the OPP and genpd core,
it was decided to set the `pstate` field via genpd's
pm_genpd_opp_to_performance_state() helper, to allow platforms to set
`pstate` even if they don't have a corresponding `level` field in the DT
OPP tables (More details are present in commit 6e41766a6a50 ("PM /
Domain: Implement of_genpd_opp_to_performance_state()")).
Revisiting that five years later clearly suggests that it was
over-designed as all current users are eventually using the `level`
value only.
The previous commit already added necessary checks to make sure pstate
is only used for genpd tables. Lets now simplify this a little, and use
`level` directly and remove `pstate` field altogether.
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/opp/of.c')
-rw-r--r-- | drivers/opp/of.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c index e23ce6e78eb6..e6d1155d0990 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -945,9 +945,6 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *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); if (ret) { /* Don't return error for duplicate OPPs */ @@ -1400,7 +1397,7 @@ int of_get_required_opp_performance_state(struct device_node *np, int index) opp = _find_opp_of_np(opp_table, required_np); if (opp) { - pstate = opp->pstate; + pstate = opp->level; dev_pm_opp_put(opp); } |