summaryrefslogtreecommitdiffstats
path: root/drivers/opp
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2018-01-11 23:33:45 -0500
committerViresh Kumar <viresh.kumar@linaro.org>2018-05-09 00:45:19 -0400
commite2f4b5f8dc59c28605a320ea923905e519fd2ca7 (patch)
tree3cd38123affd84dd6b6f58a79e583cb98673a85a /drivers/opp
parenta88bd2a51e901ed8081841d647157de8153df813 (diff)
PM / OPP: Implement dev_pm_opp_get_of_node()
This adds a new helper to let the power domain drivers to access opp->np, so that they can read platform specific properties from the node. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r--drivers/opp/of.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 6380ec3d695b..de41e68b780f 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -727,3 +727,22 @@ put_opp_table:
727 return opp; 727 return opp;
728} 728}
729EXPORT_SYMBOL_GPL(of_dev_pm_opp_find_required_opp); 729EXPORT_SYMBOL_GPL(of_dev_pm_opp_find_required_opp);
730
731/**
732 * dev_pm_opp_get_of_node() - Gets the DT node corresponding to an opp
733 * @opp: opp for which DT node has to be returned for
734 *
735 * Return: DT node corresponding to the opp, else 0 on success.
736 *
737 * The caller needs to put the node with of_node_put() after using it.
738 */
739struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp)
740{
741 if (IS_ERR_OR_NULL(opp)) {
742 pr_err("%s: Invalid parameters\n", __func__);
743 return NULL;
744 }
745
746 return of_node_get(opp->np);
747}
748EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node);