aboutsummaryrefslogtreecommitdiff
path: root/drivers/opp
diff options
context:
space:
mode:
authorViresh Kumar2019-07-08 11:24:56 +0530
committerViresh Kumar2019-07-26 13:23:31 +0530
commit17a8f868ae3e85a173843b1ac65e744e8585bc5a (patch)
tree366428704840f67d53e5109a755c05fe628f5baa /drivers/opp
parentbaea35e4db17a72145c84a401f70d496c8ebf833 (diff)
opp: Return genpd virtual devices from dev_pm_opp_attach_genpd()
The cpufreq drivers don't need to do runtime PM operations on the virtual devices returned by dev_pm_domain_attach_by_name() and so the virtual devices weren't shared with the callers of dev_pm_opp_attach_genpd() earlier. But the IO device drivers would want to do that. This patch updates the prototype of dev_pm_opp_attach_genpd() to accept another argument to return the pointer to the array of genpd virtual devices. Reported-by: Rajendra Nayak <rnayak@codeaurora.org> Tested-by: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r--drivers/opp/core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 08b830f84d8c..bdb435822401 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1771,6 +1771,7 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
* dev_pm_opp_attach_genpd - Attach genpd(s) for the device and save virtual device pointer
* @dev: Consumer device for which the genpd is getting attached.
* @names: Null terminated array of pointers containing names of genpd to attach.
+ * @virt_devs: Pointer to return the array of virtual devices.
*
* Multiple generic power domains for a device are supported with the help of
* virtual genpd devices, which are created for each consumer device - genpd
@@ -1788,7 +1789,8 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
* The order of entries in the names array must match the order in which
* "required-opps" are added in DT.
*/
-struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names)
+struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
+ const char **names, struct device ***virt_devs)
{
struct opp_table *opp_table;
struct device *virt_dev;
@@ -1842,6 +1844,8 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names
name++;
}
+ if (virt_devs)
+ *virt_devs = opp_table->genpd_virt_devs;
mutex_unlock(&opp_table->genpd_virt_dev_lock);
return opp_table;