diff options
author | Darius Augulis <augulis.darius@gmail.com> | 2008-10-15 08:38:30 (GMT) |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-10-30 14:56:35 (GMT) |
commit | 5cac9d6558009d0fcdb7a0f38247ca578c8c685b (patch) | |
tree | 131c1105265bd3b8587c9578823b3e1347a55258 /arch | |
parent | eadefeff9c5572d82c2f5d907a0bfb3ba55ce901 (diff) | |
download | linux-fsl-qoriq-5cac9d6558009d0fcdb7a0f38247ca578c8c685b.tar.xz |
[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 <augulis.darius@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-mxc/gpio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index 733e0ac..de5c474 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) |