From: Andrew Victor Date: Thu, 22 Feb 2007 08:38:52 +0000 (+0100) Subject: [ARM] 4232/1: AT91: Generic GPIO bug X-Git-Tag: v2.6.21-rc2~28^2~6 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ebffe39f8ec8b5b126d9505852a396371014555;p=linux-2.6 [ARM] 4232/1: AT91: Generic GPIO bug The new gpio_direction_input() and gpio_direction_output() functions were both enabling output mode. When configuring a GPIO for input mode, you need to program the ODR (Output Disable Register). Signed-off-by: Andrew Victor Signed-off-by: Russell King --- diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index 7b87f3f101..44211a0af1 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c @@ -210,7 +210,7 @@ int gpio_direction_input(unsigned pin) if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) return -EINVAL; - __raw_writel(mask, pio + PIO_OER); + __raw_writel(mask, pio + PIO_ODR); return 0; } EXPORT_SYMBOL(gpio_direction_input);