diff options
author | loos <loos@FreeBSD.org> | 2014-05-09 13:44:42 +0000 |
---|---|---|
committer | loos <loos@FreeBSD.org> | 2014-05-09 13:44:42 +0000 |
commit | d57ffd9d8ec5bcd3aee4aa61b627684cc486a5b7 (patch) | |
tree | 7ab628aac08fced7e45cf6f23eb8ff04fb2a2f4d | |
parent | 0d127c3d771123baf79c9bf71f6db3745b483705 (diff) | |
download | FreeBSD-src-d57ffd9d8ec5bcd3aee4aa61b627684cc486a5b7.zip FreeBSD-src-d57ffd9d8ec5bcd3aee4aa61b627684cc486a5b7.tar.gz |
When a GPIO pin is set to be turned on by kernel hints (hint.gpio.X.pinon)
make sure the GPIO pin is configured as an output as this is not always the
case.
-rw-r--r-- | sys/mips/atheros/ar71xx_gpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/mips/atheros/ar71xx_gpio.c b/sys/mips/atheros/ar71xx_gpio.c index c6933bc..1a2d1e9 100644 --- a/sys/mips/atheros/ar71xx_gpio.c +++ b/sys/mips/atheros/ar71xx_gpio.c @@ -437,10 +437,13 @@ ar71xx_gpio_attach(device_t dev) ar71xx_gpio_pin_configure(sc, &sc->gpio_pins[i], DEFAULT_CAPS); i++; } + /* Turn on the hinted pins. */ for (i = 0; i < sc->gpio_npins; i++) { j = sc->gpio_pins[i].gp_pin; - if ((pinon & (1 << j)) != 0) + if ((pinon & (1 << j)) != 0) { + ar71xx_gpio_pin_setflags(dev, j, GPIO_PIN_OUTPUT); ar71xx_gpio_pin_set(dev, j, 1); + } } device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); |