Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tomer Maimon and committed by
Linus Walleij
a6059c86 5a002bf2

+1 -1
+1 -1
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
··· 1790 1790 bank->direction_input(&bank->gc, pin % bank->gc.ngpio); 1791 1791 break; 1792 1792 case PIN_CONFIG_OUTPUT: 1793 - iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES); 1794 1793 bank->direction_output(&bank->gc, pin % bank->gc.ngpio, arg); 1794 + iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES); 1795 1795 break; 1796 1796 case PIN_CONFIG_DRIVE_PUSH_PULL: 1797 1797 npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_OTYP, gpio);