Skip to content
Snippets Groups Projects
Commit 6585443a authored by Haibo Chen's avatar Haibo Chen Committed by Frieder Schrempf
Browse files

gpio: vf610: set value before the direction to avoid a glitch


commit fc363413 upstream.

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: 659d8a62 ("gpio: vf610: add imx7ulp support")
Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
[Bartosz: tweak the commit message]
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f174b13b
No related branches found
No related tags found
1 merge request!109🤖 Sync Bot: Update v5.10-ktn to Latest Stable Kernel (v5.10.199)
......@@ -127,14 +127,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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment