Commit a2d03a1d authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu

Blackfin arch: unify port_setup() to reduce arch differences

Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 6c7ec0ec
...@@ -261,29 +261,25 @@ static int cmp_label(unsigned short ident, const char *label) ...@@ -261,29 +261,25 @@ static int cmp_label(unsigned short ident, const char *label)
return -EINVAL; return -EINVAL;
} }
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
static void port_setup(unsigned gpio, unsigned short usage) static void port_setup(unsigned gpio, unsigned short usage)
{ {
if (!check_gpio(gpio)) { if (check_gpio(gpio))
return;
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
if (usage == GPIO_USAGE) if (usage == GPIO_USAGE)
*port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
else else
*port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
SSYNC(); SSYNC();
}
}
#elif defined(BF548_FAMILY) #elif defined(BF548_FAMILY)
static void port_setup(unsigned gpio, unsigned short usage)
{
if (usage == GPIO_USAGE) if (usage == GPIO_USAGE)
gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
else else
gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
SSYNC(); SSYNC();
}
#else
# define port_setup(...) do { } while (0)
#endif #endif
}
#ifdef BF537_FAMILY #ifdef BF537_FAMILY
static struct { static struct {
......
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