]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Blackfin arch: Add workaround to read edge triggered GPIOs
authorMichael Hennerich <michael.hennerich@analog.com>
Sat, 17 May 2008 08:01:51 +0000 (16:01 +0800)
committerBryan Wu <cooloney@kernel.org>
Sat, 17 May 2008 08:01:51 +0000 (16:01 +0800)
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/kernel/bfin_gpio.c
include/asm-blackfin/gpio.h

index 7e8eaf4a31bbc64ffbe17602c5b8ec1bbd8e8c45..b6d89d1644cc8515c1909865e01fdf83e9ede39f 100644 (file)
@@ -1130,6 +1130,25 @@ void bfin_gpio_irq_prepare(unsigned gpio)
 
 #else
 
+int gpio_get_value(unsigned gpio)
+{
+       unsigned long flags;
+       int ret;
+
+       if (unlikely(get_gpio_edge(gpio))) {
+               local_irq_save(flags);
+               set_gpio_edge(gpio, 0);
+               ret = get_gpio_data(gpio);
+               set_gpio_edge(gpio, 1);
+               local_irq_restore(flags);
+
+               return ret;
+       } else
+               return get_gpio_data(gpio);
+}
+EXPORT_SYMBOL(gpio_get_value);
+
+
 int gpio_direction_input(unsigned gpio)
 {
        unsigned long flags;
index 27ff532a806c6fc1aa804f05c79e5c47f0518963..ff95e9d883427fca797a9f6c84c7b9f21076f1ff 100644 (file)
@@ -437,7 +437,6 @@ void gpio_set_value(unsigned gpio, int arg);
 int gpio_get_value(unsigned gpio);
 
 #ifndef BF548_FAMILY
-#define gpio_get_value(gpio)           get_gpio_data(gpio)
 #define gpio_set_value(gpio, value)    set_gpio_data(gpio, value)
 #endif