summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomer Maimon <tmaimon77@gmail.com>2023-11-15 13:12:09 -0800
committerLinus Walleij <linus.walleij@linaro.org>2023-11-24 11:22:11 +0100
commita6059c8603bc90746bf0df930ff78013b4c789fe (patch)
tree399b58833b2f56bba6d041ed4972284eba8adc96
parent5a002bf206508169dd9d8c002d6326e51f53b42c (diff)
downloadlinux-stable-a6059c8603bc90746bf0df930ff78013b4c789fe.tar.gz
linux-stable-a6059c8603bc90746bf0df930ff78013b4c789fe.tar.bz2
linux-stable-a6059c8603bc90746bf0df930ff78013b4c789fe.zip
pinctrl: npcm7xx: prevent glitch when setting the GPIO to output high
Enable GPIO output after setting the output value to prevent a glitch when pinctrl driver sets gpio pin to output high and the pin is in the default state (high->low->high). Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: William A. Kennington III <william@wkennington.com> Link: https://lore.kernel.org/r/20231115211209.1683449-1-william@wkennington.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
index 1e658721aaba..62a46d824b46 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
@@ -1790,8 +1790,8 @@ static int npcm7xx_config_set_one(struct npcm7xx_pinctrl *npcm,
bank->direction_input(&bank->gc, pin % bank->gc.ngpio);
break;
case PIN_CONFIG_OUTPUT:
- iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES);
bank->direction_output(&bank->gc, pin % bank->gc.ngpio, arg);
+ iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES);
break;
case PIN_CONFIG_DRIVE_PUSH_PULL:
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_OTYP, gpio);