Commit a6059c86 authored by Tomer Maimon's avatar Tomer Maimon Committed by Linus Walleij
Browse files

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: default avatarTomer Maimon <tmaimon77@gmail.com>
Signed-off-by: default avatarWilliam A. Kennington III <william@wkennington.com>
Link: https://lore.kernel.org/r/20231115211209.1683449-1-william@wkennington.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5a002bf2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);