aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/opp/of.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2018-06-13 16:00:11 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2018-11-05 07:40:42 +0530
commit61d8e7c73b0b55a529fe7e9cb0cccccf50ee967a (patch)
treec42763ef4f2f4971c77aebf05694e680ee8090e6 /drivers/opp/of.c
parentPM / Domains: Rename genpd virtual devices as virt_dev (diff)
downloadlinux-dev-61d8e7c73b0b55a529fe7e9cb0cccccf50ee967a.tar.xz
linux-dev-61d8e7c73b0b55a529fe7e9cb0cccccf50ee967a.zip
OPP: Identify and mark genpd OPP tables
We need to handle genpd OPP tables differently, this is already the case at one location and will be extended going forward. Add another field to the OPP table to check if the table belongs to a genpd or not. 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 5a4b47958073..5f114cd3d88c 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -92,6 +92,9 @@ void _of_init_opp_table(struct opp_table *opp_table, struct device *dev,
of_property_read_u32(np, "voltage-tolerance",
&opp_table->voltage_tolerance_v1);
+ if (of_find_property(np, "#power-domain-cells", NULL))
+ opp_table->is_genpd = true;
+
/* Get OPP table node */
opp_np = _opp_of_get_opp_desc_node(np, index);
of_node_put(np);
@@ -326,8 +329,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
ret = of_property_read_u64(np, "opp-hz", &rate);
if (ret < 0) {
/* "opp-hz" is optional for devices like power domains. */
- if (!of_find_property(dev->of_node, "#power-domain-cells",
- NULL)) {
+ if (!opp_table->is_genpd) {
dev_err(dev, "%s: opp-hz not found\n", __func__);
goto free_opp;
}