Thread (8 messages) flat view 8 messages, 1 author, 2010-07-29
STALE5849d

[PATCH 3/7] ARM: LPC32xx: Fix gpiolib bit mask macro

From: wellsk40 at gmail.com <hidden>
Date: 2010-07-29 16:04:10
Subsystem: arm port, arm/lpc32xx soc support, the rest · Maintainers: Russell King, Vladimir Zapolskiy, Piotr Wojtaszczyk, Linus Torvalds

From: Kevin Wells <redacted>

The GPIO bank 3 input mask macro was missing a critical mask that
would cause it to return invalid pin states.

Signed-off-by: Kevin Wells <redacted>
---
 arch/arm/mach-lpc32xx/gpiolib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/gpiolib.c b/arch/arm/mach-lpc32xx/gpiolib.c
index 69061ea..073bc9b 100644
--- a/arch/arm/mach-lpc32xx/gpiolib.c
+++ b/arch/arm/mach-lpc32xx/gpiolib.c
@@ -59,7 +59,7 @@
 #define GPO3_PIN_TO_BIT(x)			(1 << (x))
 #define GPIO012_PIN_IN_SEL(x, y)		(((x) >> (y)) & 1)
 #define GPIO3_PIN_IN_SHIFT(x)			((x) == 5 ? 24 : 10 + (x))
-#define GPIO3_PIN_IN_SEL(x, y)			((x) >> GPIO3_PIN_IN_SHIFT(y))
+#define GPIO3_PIN_IN_SEL(x, y)			(((x) >> GPIO3_PIN_IN_SHIFT(y)) & 1)
 #define GPIO3_PIN5_IN_SEL(x)			(((x) >> 24) & 1)
 #define GPI3_PIN_IN_SEL(x, y)			(((x) >> (y)) & 1)
 
-- 
1.7.1.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help