Skip to content

Commit c57d75c

Browse files
tpetazzonilinusw
authored andcommitted
gpio: mvebu: correctly set the value in direction_output()
The ->direction_output() operation of gpio_chip is supposed to set the direction to output but also to set the GPIO to an initial value. Unfortunately, this last part was not done until now, causing for example the LEDs to not be properly set to their default initial value. This patch fixes this by calling the mvebu_gpio_set() function from mvebu_gpio_direction_output() before configuring the GPIO as an output GPIO. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent a48221a commit c57d75c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin,
244244
if (ret)
245245
return ret;
246246

247+
mvebu_gpio_set(chip, pin, value);
248+
247249
spin_lock_irqsave(&mvchip->lock, flags);
248250
u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip));
249251
u &= ~(1 << pin);

0 commit comments

Comments
 (0)