public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP3 GPIO: Fix getting the value of the GPIO output pin
@ 2009-02-07  4:15 Joonyoung Shim
  2009-02-08 19:56 ` David Brownell
  0 siblings, 1 reply; 5+ messages in thread
From: Joonyoung Shim @ 2009-02-07  4:15 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: linux-omap, Tony Lindgren

If the GPIO pin is output, must read the value from OMAP24XX_GPIO_DATAOUT
register in __omap_get_gpio_datain().

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index f856a90..296773a 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -428,7 +428,11 @@ static int __omap_get_gpio_datain(int gpio)
 #endif
 #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
 	case METHOD_GPIO_24XX:
-		reg += OMAP24XX_GPIO_DATAIN;
+		if (__raw_readl(reg + OMAP24XX_GPIO_OE)
+					& (1 << get_gpio_index(gpio)))
+			reg += OMAP24XX_GPIO_DATAIN;
+		else
+			reg += OMAP24XX_GPIO_DATAOUT;
 		break;
 #endif
 	default:

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-09 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-07  4:15 [PATCH] OMAP3 GPIO: Fix getting the value of the GPIO output pin Joonyoung Shim
2009-02-08 19:56 ` David Brownell
     [not found]   ` <4e1455be0902081838y27b34dc4ia283768bbc16408c@mail.gmail.com>
     [not found]     ` <200902082011.36500.david-b@pacbell.net>
2009-02-09  5:29       ` Joonyoung Shim
2009-02-09  5:53         ` David Brownell
2009-02-09 12:19           ` Joonyoung Shim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox