Commit 803a8d2a authored by Michael Hennerich's avatar Michael Hennerich Committed by Bryan Wu

Blackfin arch: Add workaround to read edge triggered GPIOs

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 92322da9
......@@ -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;
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment