public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] [INPUT/KEYPAD] gpio keypad: Replace current blackfin specific pfbutton driver with kernel generic gpio key driver
@ 2008-05-12 10:17 Bryan Wu
  2008-05-12 11:27 ` pHilipp Zabel
  2008-05-12 16:55 ` David Brownell
  0 siblings, 2 replies; 10+ messages in thread
From: Bryan Wu @ 2008-05-12 10:17 UTC (permalink / raw)
  To: dbrownell, dmitry.torokhov, philipp.zabel
  Cc: linux-kernel, Michael Hennerich, Bryan Wu

From: Michael Hennerich <michael.hennerich@analog.com>

It's an actual deficiency in the hardware that we can't address,
so it needs to be worked around in software.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/input/keyboard/gpio_keys.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index bbd00c3..d856eb9 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -26,6 +26,18 @@
 
 #include <asm/gpio.h>
 
+#if defined(CONFIG_BLACKFIN) && !defined(BF548_FAMILY)
+
+/*
+ * On some Blackfin CPUs reading edge triggered
+ * GPIOs doesn't return the current value
+ */
+
+#define GPIOKEYS_EDGE_SENSE(x) set_gpio_edge(gpio, x)
+#else
+#define GPIOKEYS_EDGE_SENSE(x) do {} while (0)
+#endif
+
 static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
 {
 	int i;
@@ -39,8 +51,9 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
 
 		if (irq == gpio_to_irq(gpio)) {
 			unsigned int type = button->type ?: EV_KEY;
+			GPIOKEYS_EDGE_SENSE(0);
 			int state = (gpio_get_value(gpio) ? 1 : 0) ^ button->active_low;
-
+			GPIOKEYS_EDGE_SENSE(1);
 			input_event(input, type, button->code, !!state);
 			input_sync(input);
 			return IRQ_HANDLED;
-- 
1.5.5


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

end of thread, other threads:[~2008-05-13  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12 10:17 [PATCH 1/1] [INPUT/KEYPAD] gpio keypad: Replace current blackfin specific pfbutton driver with kernel generic gpio key driver Bryan Wu
2008-05-12 11:27 ` pHilipp Zabel
2008-05-12 11:42   ` Mike Frysinger
2008-05-12 12:11     ` Bryan Wu
2008-05-12 12:47       ` Mike Frysinger
2008-05-12 14:42         ` Bryan Wu
2008-05-12 16:54           ` David Brownell
2008-05-12 16:59             ` Mike Frysinger
2008-05-13  7:53               ` Hennerich, Michael
2008-05-12 16:55 ` David Brownell

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