diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2008-05-17 04:01:51 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-05-17 04:01:51 -0400 |
commit | 803a8d2acbf220aeb27f0a98dacb36d4af3d6559 (patch) | |
tree | 7454a713f9fdd65a40d6881eb8ccca4f537dd7df | |
parent | 92322da9b568a5ddc3ab872491bdc0f1b47ef904 (diff) |
Blackfin arch: Add workaround to read edge triggered GPIOs
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 19 | ||||
-rw-r--r-- | include/asm-blackfin/gpio.h | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 7e8eaf4a31bb..b6d89d1644cc 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -1130,6 +1130,25 @@ void bfin_gpio_irq_prepare(unsigned gpio) | |||
1130 | 1130 | ||
1131 | #else | 1131 | #else |
1132 | 1132 | ||
1133 | int gpio_get_value(unsigned gpio) | ||
1134 | { | ||
1135 | unsigned long flags; | ||
1136 | int ret; | ||
1137 | |||
1138 | if (unlikely(get_gpio_edge(gpio))) { | ||
1139 | local_irq_save(flags); | ||
1140 | set_gpio_edge(gpio, 0); | ||
1141 | ret = get_gpio_data(gpio); | ||
1142 | set_gpio_edge(gpio, 1); | ||
1143 | local_irq_restore(flags); | ||
1144 | |||
1145 | return ret; | ||
1146 | } else | ||
1147 | return get_gpio_data(gpio); | ||
1148 | } | ||
1149 | EXPORT_SYMBOL(gpio_get_value); | ||
1150 | |||
1151 | |||
1133 | int gpio_direction_input(unsigned gpio) | 1152 | int gpio_direction_input(unsigned gpio) |
1134 | { | 1153 | { |
1135 | unsigned long flags; | 1154 | unsigned long flags; |
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h index 27ff532a806c..ff95e9d88342 100644 --- a/include/asm-blackfin/gpio.h +++ b/include/asm-blackfin/gpio.h | |||
@@ -437,7 +437,6 @@ void gpio_set_value(unsigned gpio, int arg); | |||
437 | int gpio_get_value(unsigned gpio); | 437 | int gpio_get_value(unsigned gpio); |
438 | 438 | ||
439 | #ifndef BF548_FAMILY | 439 | #ifndef BF548_FAMILY |
440 | #define gpio_get_value(gpio) get_gpio_data(gpio) | ||
441 | #define gpio_set_value(gpio, value) set_gpio_data(gpio, value) | 440 | #define gpio_set_value(gpio, value) set_gpio_data(gpio, value) |
442 | #endif | 441 | #endif |
443 | 442 | ||