aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 8d12853a64fd..96090268e007 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -261,29 +261,25 @@ static int cmp_label(unsigned short ident, const char *label)
261 return -EINVAL; 261 return -EINVAL;
262} 262}
263 263
264#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
265static void port_setup(unsigned gpio, unsigned short usage) 264static void port_setup(unsigned gpio, unsigned short usage)
266{ 265{
267 if (!check_gpio(gpio)) { 266 if (check_gpio(gpio))
268 if (usage == GPIO_USAGE) 267 return;
269 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); 268
270 else 269#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
271 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 270 if (usage == GPIO_USAGE)
272 SSYNC(); 271 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
273 } 272 else
274} 273 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
274 SSYNC();
275#elif defined(BF548_FAMILY) 275#elif defined(BF548_FAMILY)
276static void port_setup(unsigned gpio, unsigned short usage)
277{
278 if (usage == GPIO_USAGE) 276 if (usage == GPIO_USAGE)
279 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); 277 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
280 else 278 else
281 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio); 279 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
282 SSYNC(); 280 SSYNC();
283}
284#else
285# define port_setup(...) do { } while (0)
286#endif 281#endif
282}
287 283
288#ifdef BF537_FAMILY 284#ifdef BF537_FAMILY
289static struct { 285static struct {