From: Michael Barkowski Date: Tue, 18 Aug 2009 21:20:44 +0000 (-0400) Subject: powerpc/qe_lib: Set gpio data before changing the direction to output X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1dcd8ffc81e80a170625883f63f6a5db3cd0428d;p=linux-beck.git powerpc/qe_lib: Set gpio data before changing the direction to output This avoids having a short glitch if the desired initial value is not the same as what was previously in the data register. Signed-off-by: Michael Barkowski Acked-by: Anton Vorontsov Signed-off-by: Kumar Gala --- diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c index 3485288dce31..8e7a7767dd5c 100644 --- a/arch/powerpc/sysdev/qe_lib/gpio.c +++ b/arch/powerpc/sysdev/qe_lib/gpio.c @@ -105,14 +105,14 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc); unsigned long flags; + qe_gpio_set(gc, gpio, val); + spin_lock_irqsave(&qe_gc->lock, flags); __par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0); spin_unlock_irqrestore(&qe_gc->lock, flags); - qe_gpio_set(gc, gpio, val); - return 0; }