From: Bill Gatliff Date: Thu, 31 May 2007 15:17:16 +0000 (+0100) Subject: [ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA) X-Git-Tag: firefly_0821_release~28764^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=29c349d22ccda5678a7dfb732093dbd3befcefa3;p=firefly-linux-kernel-4.4.55.git [ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA) 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 Signed-off-by: Russell King --- diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h index aeba24347f8e..9e99241f3edf 100644 --- a/include/asm-arm/arch-pxa/gpio.h +++ b/include/asm-arm/arch-pxa/gpio.h @@ -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)