summaryrefslogtreecommitdiff
path: root/drivers/opp/core.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2022-05-25 14:47:59 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2022-06-09 13:57:55 +0530
commit0a43452bb6b1f499b695b123e9fedf4b1a9bbf64 (patch)
treeb230de81ccec2e9d56e3c2b47a42398d076def59 /drivers/opp/core.c
parent9bfb1ffff1972291738b4288e7653ba7ea3c24fa (diff)
downloadlinux-0a43452bb6b1f499b695b123e9fedf4b1a9bbf64.tar.gz
linux-0a43452bb6b1f499b695b123e9fedf4b1a9bbf64.tar.bz2
linux-0a43452bb6b1f499b695b123e9fedf4b1a9bbf64.zip
OPP: Track if clock name is configured by platform
Track if the clock name is configured by the platform or not. This is a preparatory change and will be used by later commits. This also makes the behavior of the clkname API similar to other ones, which allow repeated calls to the same API for each CPU. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp/core.c')
-rw-r--r--drivers/opp/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index b2715950e76d..e166bfe5fc90 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -2277,6 +2277,10 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name)
goto err;
}
+ /* Another CPU that shares the OPP table has set the clkname ? */
+ if (opp_table->clk_configured)
+ return opp_table;
+
/* clk shouldn't be initialized at this point */
if (WARN_ON(opp_table->clk)) {
ret = -EBUSY;
@@ -2291,6 +2295,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name)
goto err;
}
+ opp_table->clk_configured = true;
+
return opp_table;
err:
@@ -2311,6 +2317,7 @@ void dev_pm_opp_put_clkname(struct opp_table *opp_table)
clk_put(opp_table->clk);
opp_table->clk = ERR_PTR(-EINVAL);
+ opp_table->clk_configured = false;
dev_pm_opp_put_opp_table(opp_table);
}