Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/atheros/ar71xx_gpio.c
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* On AR934x and QCA953x, it's the opposite - the bit set means | * On AR934x and QCA953x, it's the opposite - the bit set means | ||||
* "input enable". | * "input enable". | ||||
*/ | */ | ||||
static int | static int | ||||
ar71xx_gpio_oe_is_high(void) | ar71xx_gpio_oe_is_high(void) | ||||
{ | { | ||||
switch (ar71xx_soc) { | switch (ar71xx_soc) { | ||||
case AR71XX_SOC_AR9341: | |||||
case AR71XX_SOC_AR9342: | |||||
case AR71XX_SOC_AR9344: | case AR71XX_SOC_AR9344: | ||||
case AR71XX_SOC_QCA9533: | case AR71XX_SOC_QCA9533: | ||||
case AR71XX_SOC_QCA9533_V2: | case AR71XX_SOC_QCA9533_V2: | ||||
return 0; | return 0; | ||||
default: | default: | ||||
return 1; | return 1; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | for (i = 0; i <= maxpin; i++) { | ||||
/* Get the mode too */ | /* Get the mode too */ | ||||
snprintf(buf, 32, "func.%d.gpiomode", i); | snprintf(buf, 32, "func.%d.gpiomode", i); | ||||
if (resource_int_value(device_get_name(dev), | if (resource_int_value(device_get_name(dev), | ||||
device_get_unit(dev), | device_get_unit(dev), | ||||
buf, | buf, | ||||
&gpiomode) != 0) | &gpiomode) != 0) | ||||
continue; | continue; | ||||
/* We only handle mode=1 for now */ | /* We only handle mode=1 (output) for now */ | ||||
if (gpiomode != 1) | if (gpiomode != 1) | ||||
continue; | continue; | ||||
device_printf(dev, "%s: GPIO %d: func=%d, mode=%d\n", | device_printf(dev, "%s: GPIO %d: func=%d, mode=%d\n", | ||||
__func__, | __func__, | ||||
i, | i, | ||||
gpiofunc, | gpiofunc, | ||||
gpiomode); | gpiomode); | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |