mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 06:08:22 +00:00
gpio: aspeed: Set output latch before changing direction
In aspeed_gpio_dir_out(), we need to establish the new output value in the output latch *before* we change the direction to output in order to avoid a glitch on the output line if the previous value of the latch was different. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Christopher Bostic <cbostic@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
d5dbf9c266
commit
af79492849
1 changed files with 1 additions and 2 deletions
|
@ -287,11 +287,10 @@ static int aspeed_gpio_dir_out(struct gpio_chip *gc,
|
|||
|
||||
spin_lock_irqsave(&gpio->lock, flags);
|
||||
|
||||
__aspeed_gpio_set(gc, offset, val);
|
||||
reg = ioread32(bank_val_reg(gpio, bank, GPIO_DIR));
|
||||
iowrite32(reg | GPIO_BIT(offset), bank_val_reg(gpio, bank, GPIO_DIR));
|
||||
|
||||
__aspeed_gpio_set(gc, offset, val);
|
||||
|
||||
spin_unlock_irqrestore(&gpio->lock, flags);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue