Skip to content

Commit

Permalink
[ARM] MXC: Fix mxc_gpio_get(), which must read PSR register instead DR.
Browse files Browse the repository at this point in the history
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 <augulis.darius@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Darius Augulis authored and Sascha Hauer committed Oct 30, 2008
1 parent eadefef commit 5cac9d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/plat-mxc/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5cac9d6

Please sign in to comment.