summaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-05-17 16:01:51 +0800
committerBryan Wu <cooloney@kernel.org>2008-05-17 16:01:51 +0800
commit803a8d2acbf220aeb27f0a98dacb36d4af3d6559 (patch)
tree7454a713f9fdd65a40d6881eb8ccca4f537dd7df /arch/blackfin
parent92322da9b568a5ddc3ab872491bdc0f1b47ef904 (diff)
downloadop-kernel-dev-803a8d2acbf220aeb27f0a98dacb36d4af3d6559.zip
op-kernel-dev-803a8d2acbf220aeb27f0a98dacb36d4af3d6559.tar.gz
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>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 7e8eaf4..b6d89d1 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)
#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;
OpenPOWER on IntegriCloud