diff options
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 19 |
1 files changed, 19 insertions, 0 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; |