Skip to content

Commit

Permalink
[ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bill Gatliff authored and Russell King committed Jun 2, 2007
1 parent b6b27ae commit 29c349d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/asm-arm/arch-pxa/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 29c349d

Please sign in to comment.