[PATCH 2/7] imx/gpio: make gpio_get_value actually work

Wolfram Sang w.sang at pengutronix.de
Fri Apr 23 02:22:40 EDT 2010


From: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

The value read at the pin is provided by Sample Status Register, not the
Data Register.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
---
 arch/arm/mach-imx/gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/gpio.c b/arch/arm/mach-imx/gpio.c
index 6157bd1..c6a59a6 100644
--- a/arch/arm/mach-imx/gpio.c
+++ b/arch/arm/mach-imx/gpio.c
@@ -121,7 +121,7 @@ int gpio_get_value(unsigned gpio)
 	if (!base)
 		return -EINVAL;
 
-	val = readl(base + GPIO_DR);
+	val = readl(base + GPIO_PSR);
 
 	return val & (1 << shift) ? 1 : 0;
 }
-- 
1.7.0




More information about the barebox mailing list