[PATCH] bcm47xx : fix gpio_direction_output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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

Signed-off-by: Matthieu CASTET <castet.matthieu@xxxxxxx> 
Acked-by: Aurelien Jarno <aurelien@xxxxxxxxxxx>
Index: linux-2.6/arch/mips/include/asm/mach-bcm47xx/gpio.h
===================================================================
--- linux-2.6.orig/arch/mips/include/asm/mach-bcm47xx/gpio.h	2009-05-24 19:43:55.000000000 +0200
+++ linux-2.6/arch/mips/include/asm/mach-bcm47xx/gpio.h	2009-05-24 19:44:56.000000000 +0200
@@ -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;
 }

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux