aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch
diff options
context:
space:
mode:
authorDENG Qingfang <dengqf6@mail2.sysu.edu.cn>2020-03-17 20:54:34 +0800
committerChuanhong Guo <gch981213@gmail.com>2020-04-04 14:14:43 +0800
commit7bd19dbe99b18c5dfd85a004595df6061e8df8f6 (patch)
treed1c5b8e9bf3e5c57015ece5b4b61166af8d94b3b /target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch
parent9ebb85c372e525b08debe286d976a6376ca0dbbe (diff)
downloadupstream-7bd19dbe99b18c5dfd85a004595df6061e8df8f6.tar.gz
upstream-7bd19dbe99b18c5dfd85a004595df6061e8df8f6.tar.bz2
upstream-7bd19dbe99b18c5dfd85a004595df6061e8df8f6.zip
ramips: mt7621: backport GPIO driver fix
Backport 2 patches from linux-next to fix mt7621 GPIO driver Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Diffstat (limited to 'target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch')
-rw-r--r--target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch b/target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch
new file mode 100644
index 0000000000..862f9adb47
--- /dev/null
+++ b/target/linux/ramips/patches-5.4/112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch
@@ -0,0 +1,33 @@
+From ad65f02fd73e9a700f1693a4513ae923ca07beb0 Mon Sep 17 00:00:00 2001
+From: Chuanhong Guo <gch981213@gmail.com>
+Date: Sun, 15 Mar 2020 20:13:38 +0800
+Subject: [PATCH] gpio: mt7621: add BGPIOF_NO_SET_ON_INPUT flag
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+DSET/DCLR registers only works on output pins. Add corresponding
+BGPIOF_NO_SET_ON_INPUT flag to bgpio_init call to fix direction_out
+behavior.
+
+Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
+Tested-by: René van Dorst <opensource@vdorst.com>
+Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
+Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+---
+ drivers/gpio/gpio-mt7621.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpio/gpio-mt7621.c
++++ b/drivers/gpio/gpio-mt7621.c
+@@ -227,8 +227,8 @@ mediatek_gpio_bank_probe(struct device *
+ ctrl = mtk->base + GPIO_REG_DCLR + (rg->bank * GPIO_BANK_STRIDE);
+ diro = mtk->base + GPIO_REG_CTRL + (rg->bank * GPIO_BANK_STRIDE);
+
+- ret = bgpio_init(&rg->chip, dev, 4,
+- dat, set, ctrl, diro, NULL, 0);
++ ret = bgpio_init(&rg->chip, dev, 4, dat, set, ctrl, diro, NULL,
++ BGPIOF_NO_SET_ON_INPUT);
+ if (ret) {
+ dev_err(dev, "bgpio_init() failed\n");
+ return ret;