Skip to contentSkip to conversation

fix gpio_direction_output for bcm47xx

PATCH In review matthieu castet 2 participants 3 messages May 16, 2009 – May 24, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix gpio_direction_output for bcm47xx

gpio_direction_output should also set to a output value per gpio API.

arch/mips/include/asm/mach-bcm47xx/gpio.h +3 -0
index 1784fde..9850414 100644
@@ -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;
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · matthieu castet

gpio_direction_output should also set to a output value per gpio API.

Quoted 14 lines
arch/mips/include/asm/mach-bcm47xx/gpio.h +3 -0
index 1784fde..9850414 100644
@@ -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;
 }
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#2 lore raw

PATCH 1/1 bcm47xx : fix gpio_direction_output

gpio_direction_output should also set an output value according to the API.

arch/mips/include/asm/mach-bcm47xx/gpio.h +3 -0
Index: linux-2.6/arch/mips/include/asm/mach-bcm47xx/gpio.h
===================================================================
@@ -37,6 +37,9 @@
 
 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;
 }