linux-mips
[Top] [All Lists]

[PATCH] fix gpio_direction_output for bcm47xx

To: linux-mips@linux-mips.org
Subject: [PATCH] fix gpio_direction_output for bcm47xx
From: matthieu castet <castet.matthieu@free.fr>
Date: Sat, 16 May 2009 15:15:35 +0200
Cc: Aurelien Jarno <aurelien@aurel32.net>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081204 Iceape/1.1.14 (Debian-1.1.14-1)
gpio_direction_output should also set to a output value per gpio API.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h 
b/arch/mips/include/asm/mach-bcm47xx/gpio.h
index 1784fde..9850414 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;
 }
<Prev in Thread] Current Thread [Next in Thread>