Skip to content

Commit fc36341

Browse files
Haibo ChenBartosz Golaszewski
authored andcommitted
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: 659d8a6 ("gpio: vf610: add imx7ulp support") Signed-off-by: Haibo Chen <[email protected]> [Bartosz: tweak the commit message] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 4302326 commit fc36341

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-vf610.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
126126
unsigned long mask = BIT(gpio);
127127
u32 val;
128128

129+
vf610_gpio_set(chip, gpio, value);
130+
129131
if (port->sdata && port->sdata->have_paddr) {
130132
val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
131133
val |= mask;
132134
vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
133135
}
134136

135-
vf610_gpio_set(chip, gpio, value);
136-
137137
return pinctrl_gpio_direction_output(chip->base + gpio);
138138
}
139139

0 commit comments

Comments
 (0)