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-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5cac9d6558009d0fcdb7a0f38247ca578c8c685b;p=linux-beck.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 733e0acac916..de5c4747453f 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)