aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-5.10/0051-PM-OPP-Add-a-helper-to-get-an-opp-regulator-for-devi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ipq806x/patches-5.10/0051-PM-OPP-Add-a-helper-to-get-an-opp-regulator-for-devi.patch')
-rw-r--r--target/linux/ipq806x/patches-5.10/0051-PM-OPP-Add-a-helper-to-get-an-opp-regulator-for-devi.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.10/0051-PM-OPP-Add-a-helper-to-get-an-opp-regulator-for-devi.patch b/target/linux/ipq806x/patches-5.10/0051-PM-OPP-Add-a-helper-to-get-an-opp-regulator-for-devi.patch
new file mode 100644
index 0000000000..35fe45fca7
--- /dev/null
+++ b/target/linux/ipq806x/patches-5.10/0051-PM-OPP-Add-a-helper-to-get-an-opp-regulator-for-devi.patch
@@ -0,0 +1,52 @@
+From d06ca5e7a3cf726f5be5ffd96e93ccd798b8c09a Mon Sep 17 00:00:00 2001
+From: Georgi Djakov <georgi.djakov@linaro.org>
+Date: Thu, 12 May 2016 14:41:33 +0300
+Subject: [PATCH 51/69] PM / OPP: Add a helper to get an opp regulator for
+ device
+
+Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
+---
+ drivers/opp/core.c | 21 +++++++++++++++++++++
+ include/linux/pm_opp.h | 1 +
+ 2 files changed, 22 insertions(+)
+
+--- a/drivers/opp/core.c
++++ b/drivers/opp/core.c
+@@ -127,6 +127,27 @@ unsigned long dev_pm_opp_get_freq(struct
+ }
+ EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq);
+
++struct regulator *dev_pm_opp_get_regulator(struct device *dev)
++{
++ struct opp_table *opp_table;
++ struct regulator *reg;
++
++ rcu_read_lock();
++
++ opp_table = _find_opp_table(dev);
++ if (IS_ERR(opp_table)) {
++ rcu_read_unlock();
++ return ERR_CAST(opp_table);
++ }
++
++ reg = opp_table->regulators[0];
++
++ rcu_read_unlock();
++
++ return reg;
++}
++EXPORT_SYMBOL_GPL(dev_pm_opp_get_regulator);
++
+ /**
+ * dev_pm_opp_get_level() - Gets the level corresponding to an available opp
+ * @opp: opp for which level value has to be returned for
+--- a/include/linux/pm_opp.h
++++ b/include/linux/pm_opp.h
+@@ -83,6 +83,7 @@ void dev_pm_opp_put_opp_table(struct opp
+ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
+
+ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp);
++struct regulator *dev_pm_opp_get_regulator(struct device *dev);
+
+ unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
+