aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2017-07-15 22:50:41 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2017-09-18 20:34:55 +0200
commit34a422794ddab738408edc7e3980ccbc14f28af4 (patch)
tree06f99aeb1acab719dea0a5743d44c2026613edbb /target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch
parente080a7ce07ee8cd63c71e1469853a233d9bc7a4c (diff)
downloadupstream-34a422794ddab738408edc7e3980ccbc14f28af4.tar.gz
upstream-34a422794ddab738408edc7e3980ccbc14f28af4.tar.bz2
upstream-34a422794ddab738408edc7e3980ccbc14f28af4.zip
sunxi: Backport patches needed for A64
This backports multiple patches from kernel 4.10 which are adding missing support for the A64 and the pine64 board. These are the device tree files, the pinctlk and the clock driver. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch')
-rw-r--r--target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch b/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch
new file mode 100644
index 0000000000..4921240f79
--- /dev/null
+++ b/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch
@@ -0,0 +1,40 @@
+From 223dba00b4072efc590c7d648f230db1b44186b9 Mon Sep 17 00:00:00 2001
+From: Chen-Yu Tsai <wens@csie.org>
+Date: Fri, 11 Nov 2016 17:50:34 +0800
+Subject: pinctrl: sunxi: Fix PIN_CONFIG_BIAS_PULL_{DOWN,UP} argument
+
+According to pinconf-generic.h, the argument for
+PIN_CONFIG_BIAS_PULL_{DOWN,UP} is non-zero if the bias is enabled
+with a pull up/down resistor, zero if it is directly connected
+to VDD or ground.
+
+Since Allwinner hardware uses a weak pull resistor internally,
+the argument should be 1.
+
+Signed-off-by: Chen-Yu Tsai <wens@csie.org>
+Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+---
+ drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
++++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+@@ -291,12 +291,16 @@ static unsigned long *sunxi_pctrl_build_
+
+ if (sunxi_pctrl_has_bias_prop(node)) {
+ int pull = sunxi_pctrl_parse_bias_prop(node);
++ int arg = 0;
+ if (pull < 0) {
+ ret = pull;
+ goto err_free;
+ }
+
+- pinconfig[idx++] = pinconf_to_config_packed(pull, 0);
++ if (pull != PIN_CONFIG_BIAS_DISABLE)
++ arg = 1; /* hardware uses weak pull resistors */
++
++ pinconfig[idx++] = pinconf_to_config_packed(pull, arg);
+ }
+
+