From: Matthieu Castet Date: Sun, 24 May 2009 17:48:51 +0000 (+0200) Subject: MIPS: BCM47xx: Fix gpio_direction_output X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f203b7cacb96e4bb44b6995c03152cbedfb1857f;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git MIPS: BCM47xx: Fix gpio_direction_output gpio_direction_output should also set an output value according to the API. Signed-off-by: Matthieu CASTET Acked-by: Aurelien Jarno Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h index 1784fde2e28..98504142124 100644 --- a/arch/mips/include/asm/mach-bcm47xx/gpio.h +++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h @@ -37,6 +37,9 @@ static inline int gpio_direction_input(unsigned gpio) static inline int gpio_direction_output(unsigned gpio, int value) { + /* first set the gpio out value */ + ssb_gpio_out(&ssb_bcm47xx, 1 << gpio, value ? 1 << gpio : 0); + /* then set the gpio mode */ ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1 << gpio); return 0; }