@@ -708,12 +708,20 @@ struct srcu_notifier_head *opp_get_notifier(struct device *dev)
int of_init_opp_table(struct device *dev)
{
const struct property *prop;
+ struct device_node *opp_node;
const __be32 *val;
int nr;
- prop = of_find_property(dev->of_node, "operating-points", NULL);
- if (!prop)
+ opp_node = of_parse_phandle(dev->of_node,
+ "operating-points-phandle", 0);
+ if (!opp_node) /* if no OPP phandle, search for OPPs in current node */
+ opp_node = dev->of_node;
+ prop = of_find_property(opp_node, "operating-points", NULL);
+ if (!prop) {
+ dev_warn(dev, "node %s missing operating-points property\n",
+ opp_node->full_name);
return -ENODEV;
+ }
if (!prop->value)
return -ENODATA;
@@ -740,6 +748,9 @@ int of_init_opp_table(struct device *dev)
nr -= 2;
}
+ if (opp_node != dev->of_node)
+ of_node_put(opp_node);
+
return 0;
}
EXPORT_SYMBOL_GPL(of_init_opp_table);