Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <michaelbarkowski@ruggedcom.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

authored by

Michael Barkowski and committed by
Kumar Gala
1dcd8ffc 9b9d401b

+2 -2
+2 -2
arch/powerpc/sysdev/qe_lib/gpio.c
··· 105 105 struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc); 106 106 unsigned long flags; 107 107 108 + qe_gpio_set(gc, gpio, val); 109 + 108 110 spin_lock_irqsave(&qe_gc->lock, flags); 109 111 110 112 __par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0); 111 113 112 114 spin_unlock_irqrestore(&qe_gc->lock, flags); 113 - 114 - qe_gpio_set(gc, gpio, val); 115 115 116 116 return 0; 117 117 }