summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBenoît Thébaudeau <[email protected]>2012-08-20 10:55:41 +0000
committerAlbert ARIBAUD <[email protected]>2012-09-01 14:58:28 +0200
commit5dafa4543c399d329c7b01df1afa98437861cac0 (patch)
tree2c33860a28c4d7c492e1f15e0aa8dd9a13d3e482 /drivers
parent5c8d14dfd978eb787307298110a32329e989e6ab (diff)
mxc: Make gpio_get_value() use PSR
gpio_get_value() should use PSR like Linux, not DR, because DR does not always reflect the pin state, while PSR does. This is especially useful to detect a short circuit on a GPIO pin configured as output, or to read the level of a pin controlled by a non-GPIO IOMUX function. Signed-off-by: Benoît Thébaudeau <[email protected]> Cc: Stefano Babic <[email protected]> Acked-by: Stefano Babic <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/mxc_gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 661553552e6..e9bf27841cd 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -116,7 +116,7 @@ int gpio_get_value(unsigned gpio)
regs = (struct gpio_regs *)gpio_ports[port];
- val = (readl(&regs->gpio_dr) >> gpio) & 0x01;
+ val = (readl(&regs->gpio_psr) >> gpio) & 0x01;
return val;
}