862f9adb475b8a1b5c731e35d7a2b9a686c596c6
[openwrt/staging/rmilecki.git] / target / linux / ramips / patches-5.10 / 112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch
1 From ad65f02fd73e9a700f1693a4513ae923ca07beb0 Mon Sep 17 00:00:00 2001
2 From: Chuanhong Guo <gch981213@gmail.com>
3 Date: Sun, 15 Mar 2020 20:13:38 +0800
4 Subject: [PATCH] gpio: mt7621: add BGPIOF_NO_SET_ON_INPUT flag
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 DSET/DCLR registers only works on output pins. Add corresponding
10 BGPIOF_NO_SET_ON_INPUT flag to bgpio_init call to fix direction_out
11 behavior.
12
13 Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
14 Tested-by: René van Dorst <opensource@vdorst.com>
15 Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
16 Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
17 ---
18 drivers/gpio/gpio-mt7621.c | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21 --- a/drivers/gpio/gpio-mt7621.c
22 +++ b/drivers/gpio/gpio-mt7621.c
23 @@ -227,8 +227,8 @@ mediatek_gpio_bank_probe(struct device *
24 ctrl = mtk->base + GPIO_REG_DCLR + (rg->bank * GPIO_BANK_STRIDE);
25 diro = mtk->base + GPIO_REG_CTRL + (rg->bank * GPIO_BANK_STRIDE);
26
27 - ret = bgpio_init(&rg->chip, dev, 4,
28 - dat, set, ctrl, diro, NULL, 0);
29 + ret = bgpio_init(&rg->chip, dev, 4, dat, set, ctrl, diro, NULL,
30 + BGPIOF_NO_SET_ON_INPUT);
31 if (ret) {
32 dev_err(dev, "bgpio_init() failed\n");
33 return ret;