aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.19
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2019-12-15 03:01:29 +0100
committerPetr Štetiar <ynezz@true.cz>2019-12-26 08:31:41 +0100
commite9a982e1d9e0bd1ae33cfe11d679475d02656e62 (patch)
tree4898b6c544e050b95bbd8f479f073f11ca0b70dc /target/linux/ipq806x/patches-4.19
parent456ab9a912089f41aa8dd8490b944c74225df9ae (diff)
downloadupstream-e9a982e1d9e0bd1ae33cfe11d679475d02656e62.tar.gz
upstream-e9a982e1d9e0bd1ae33cfe11d679475d02656e62.tar.bz2
upstream-e9a982e1d9e0bd1ae33cfe11d679475d02656e62.zip
ipq806x: opp/core: update patch updating voltage tolerance on voltage adjust
Rework 0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t to reflect changes upstream. - Skip unnecessary allocation of buffer to set u_volt - Change opp u_volt directly Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065] Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-4.19')
-rw-r--r--target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch33
1 files changed, 21 insertions, 12 deletions
diff --git a/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch b/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch
index 2882f505d9..f940d8ca62 100644
--- a/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch
+++ b/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch
@@ -17,22 +17,31 @@ Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
-@@ -1669,6 +1669,7 @@ int dev_pm_opp_adjust_voltage(struct dev
+@@ -1663,6 +1663,7 @@
struct opp_table *opp_table;
- struct dev_pm_opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV);
+ struct dev_pm_opp *tmp_opp, *opp = ERR_PTR(-ENODEV);
int r = 0;
+ unsigned long tol;
- /* keep the node allocated */
- new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL);
-@@ -1705,6 +1706,10 @@ int dev_pm_opp_adjust_voltage(struct dev
+ /* Find the opp_table */
+ opp_table = _find_opp_table(dev);
+@@ -1692,8 +1693,17 @@
+ goto adjust_unlock;
- /* plug in new node */
- new_opp->supplies[0].u_volt = u_volt;
+ opp->supplies->u_volt = u_volt;
+- opp->supplies->u_volt_min = u_volt_min;
+- opp->supplies->u_volt_max = u_volt_max;
++
+ tol = u_volt * opp_table->voltage_tolerance_v1 / 100;
-+ new_opp->supplies[0].u_volt = u_volt;
-+ new_opp->supplies[0].u_volt_min = u_volt - tol;
-+ new_opp->supplies[0].u_volt_max = u_volt + tol;
++ if ( u_volt_min == u_volt )
++ opp->supplies->u_volt_min = u_volt - tol;
++ else
++ opp->supplies->u_volt_min = u_volt_min;
++
++ if ( u_volt_max == u_volt )
++ opp->supplies->u_volt_max = u_volt + tol;
++ else
++ opp->supplies->u_volt_max = u_volt_max;
- list_replace(&opp->node, &new_opp->node);
- mutex_unlock(&opp_table_lock);
+ dev_pm_opp_get(opp);
+ mutex_unlock(&opp_table->lock);