[ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA)
authorBill Gatliff <bgat@billgatliff.com>
Thu, 31 May 2007 15:17:16 +0000 (16:17 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 2 Jun 2007 20:31:48 +0000 (21:31 +0100)
The default value passed through to pxa_gpio_mode() is lost
due to a missing GPIO_DFLT_HIGH mask for nonzero values.  The enclosed
patch fixes this programming error.

Signed-off-by: Bill Gatliff <bgat@billgatliff.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
include/asm-arm/arch-pxa/gpio.h

index aeba243..9e99241 100644 (file)
@@ -45,7 +45,8 @@ static inline int gpio_direction_input(unsigned gpio)
 
 static inline int gpio_direction_output(unsigned gpio, int value)
 {
-       return pxa_gpio_mode(gpio | GPIO_OUT | (value ? 0 : GPIO_DFLT_LOW));
+       return pxa_gpio_mode(gpio | GPIO_OUT |
+                         (value ? GPIO_DFLT_HIGH : GPIO_DFLT_LOW));
 }
 
 static inline int __gpio_get_value(unsigned gpio)