diff options
author | Haibo Chen <haibo.chen@nxp.com> | 2023-10-18 11:00:17 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-10-18 11:01:08 +0200 |
commit | fc363413ef8ea842ae7a99e3caf5465dafdd3a49 (patch) | |
tree | f081d9853f1b33c21ff4dde77ce0c5c48366fe3e | |
parent | gpio: vf610: mask the gpio irq in system suspend and support wakeup (diff) | |
download | linux-fc363413ef8ea842ae7a99e3caf5465dafdd3a49.tar.xz linux-fc363413ef8ea842ae7a99e3caf5465dafdd3a49.zip |
gpio: vf610: set value before the direction to avoid a glitch
We found a glitch when configuring the pad as output high. To avoid this
glitch, move the data value setting before direction config in the
function vf610_gpio_direction_output().
Fixes: 659d8a62311f ("gpio: vf610: add imx7ulp support")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
[Bartosz: tweak the commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-vf610.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index d1f05810340f..656d6b1dddb5 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -126,14 +126,14 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, unsigned long mask = BIT(gpio); u32 val; + vf610_gpio_set(chip, gpio, value); + if (port->sdata && port->sdata->have_paddr) { val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR); val |= mask; vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR); } - vf610_gpio_set(chip, gpio, value); - return pinctrl_gpio_direction_output(chip->base + gpio); } |