From: Darius Augulis Date: Wed, 15 Oct 2008 08:38:30 +0000 (+0200) Subject: [ARM] MXC: Fix mxc_gpio_get(), which must read PSR register instead DR. X-Git-Tag: v2.6.28-rc3~33^2~1^2~1 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=5cac9d6558009d0fcdb7a0f38247ca578c8c685b;p=net-next-2.6.git [ARM] MXC: Fix mxc_gpio_get(), which must read PSR register instead DR. The Data register holds the value we have written to a gpio. To get the input value we must read the Pad Status Register MX3 (or Sample Status register in MX1/2 terms) Signed-off-by: Darius Augulis Signed-off-by: Sascha Hauer --- diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index 733e0acac91..de5c4747453 100644 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c @@ -188,7 +188,7 @@ static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset) struct mxc_gpio_port *port = container_of(chip, struct mxc_gpio_port, chip); - return (__raw_readl(port->base + GPIO_DR) >> offset) & 1; + return (__raw_readl(port->base + GPIO_PSR) >> offset) & 1; } static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset)