All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-4.13 1/6] gpio/aspeed: Set output latch before changing direction
@ 2018-05-08  1:06 Benjamin Herrenschmidt
  2018-05-08  1:06 ` [PATCH linux dev-4.13 2/6] gpio/aspeed: Use a cache of output data registers Benjamin Herrenschmidt
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2018-05-08  1:06 UTC (permalink / raw)
  To: openbmc; +Cc: Christopher Bostic, Benjamin Herrenschmidt

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>
---
 drivers/gpio/gpio-aspeed.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 67f3eae3b550..ac54b9b25f74 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -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;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-05-11 10:52 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08  1:06 [PATCH linux dev-4.13 1/6] gpio/aspeed: Set output latch before changing direction Benjamin Herrenschmidt
2018-05-08  1:06 ` [PATCH linux dev-4.13 2/6] gpio/aspeed: Use a cache of output data registers Benjamin Herrenschmidt
2018-05-08 16:17   ` Christopher Bostic
2018-05-10  2:56     ` Andrew Jeffery
2018-05-08  1:06 ` [PATCH linux dev-4.13 3/6] fsi/fsi-master-gpio: Sample input data on different clock phase Benjamin Herrenschmidt
2018-05-08 16:42   ` Christopher Bostic
2018-05-08  1:06 ` [PATCH linux dev-4.13 4/6] fsi/fsi-master-gpio: Add "no-gpio-delays" option Benjamin Herrenschmidt
2018-05-08 19:54   ` Christopher Bostic
2018-05-10  3:03     ` Andrew Jeffery
2018-05-10  3:10       ` Benjamin Herrenschmidt
2018-05-08  1:06 ` [PATCH linux dev-4.13 5/6] fsi/fsi-master-gpio: Reduce turnaround clocks Benjamin Herrenschmidt
2018-05-08 19:55   ` Christopher Bostic
2018-05-08  1:06 ` [PATCH linux dev-4.13 6/6] fsi/fsi-master-gpio: Reduce dpoll clocks Benjamin Herrenschmidt
2018-05-08  1:46 ` Benjamin Herrenschmidt
2018-05-08 20:00   ` Christopher Bostic
2018-05-10  3:06     ` Andrew Jeffery
2018-05-10  3:12       ` Benjamin Herrenschmidt
2018-05-08 16:13 ` [PATCH linux dev-4.13 1/6] gpio/aspeed: Set output latch before changing direction Christopher Bostic
2018-05-10  2:50   ` Andrew Jeffery
2018-05-10  3:48     ` Joel Stanley
2018-05-11 10:51     ` Joel Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.