[RFC 3/9] PM / OPP: Add hook to modify OPPs after they are loaded.

Dave Gerlach
2014-03-14T19:25:29Z

Add a hook inside opp_init_cpufreq_table to allow all cpufreq drivers
to utilize OPP modifier functionality. Hook will return success if no
phandle is present for devices that do not use opp-modifier.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
drivers/base/power/opp.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index fa41874..eaedc6b 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -24,6 +24,7 @@
#include <linux/pm_opp.h>
#include <linux/of.h>
#include <linux/export.h>
+#include <linux/opp-modifier.h>

/*
* Internal data structure organization with the OPP layer library is as
@@ -629,6 +630,13 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
struct dev_pm_opp *opp;
struct cpufreq_frequency_table *freq_table;
int i = 0;
+ int ret;
+
+ ret = opp_modify_dev_table(dev);
+ if (ret) {
+ pr_err("failed to modify OPP table: %d\n", ret);
+ return ret;
+ }

/* Pretend as if I am an updater */
mutex_lock(&dev_opp_list_lock);
--
1.9.0