diff options
| author | Jim Liu <[email protected]> | 2023-05-09 15:07:34 +0800 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-06-01 12:32:03 -0400 |
| commit | f517f61ba85e33dc283c7f714babcb146b7e7dc4 (patch) | |
| tree | 04bdfa0a47fa8b863b278449c0e490451a8bf90e /drivers/gpio | |
| parent | 703da6d7076134c34a6d2a1805bac1ecdc5e1792 (diff) | |
pinctrl: nuvoton: set output state before enabling the output
The default output state may be different to request,
change the configuration sequence to avoid glitch.
Signed-off-by: Jim Liu <[email protected]>
Diffstat (limited to 'drivers/gpio')
| -rw-r--r-- | drivers/gpio/npcm_gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/npcm_gpio.c b/drivers/gpio/npcm_gpio.c index 8afd57fa8e5..98e5dc79c1c 100644 --- a/drivers/gpio/npcm_gpio.c +++ b/drivers/gpio/npcm_gpio.c @@ -37,14 +37,14 @@ static int npcm_gpio_direction_output(struct udevice *dev, unsigned int offset, { struct npcm_gpio_priv *priv = dev_get_priv(dev); - clrbits_le32(priv->base + GPIO_IEM, BIT(offset)); - writel(BIT(offset), priv->base + GPIO_OES); - if (value) setbits_le32(priv->base + GPIO_DOUT, BIT(offset)); else clrbits_le32(priv->base + GPIO_DOUT, BIT(offset)); + clrbits_le32(priv->base + GPIO_IEM, BIT(offset)); + writel(BIT(offset), priv->base + GPIO_OES); + return 0; } |
