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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux