diff options
author | ganbold <ganbold@FreeBSD.org> | 2013-02-19 02:01:35 +0000 |
---|---|---|
committer | ganbold <ganbold@FreeBSD.org> | 2013-02-19 02:01:35 +0000 |
commit | 66b9a88a9276238dd82d4e95992133baa9881fcd (patch) | |
tree | ec689eb4011ff184a51e4f0fcf92a98922924b36 /sys/arm | |
parent | 34f552176e9a22f439ad9a49b8b17a9195cb06ba (diff) | |
download | FreeBSD-src-66b9a88a9276238dd82d4e95992133baa9881fcd.zip FreeBSD-src-66b9a88a9276238dd82d4e95992133baa9881fcd.tar.gz |
Define gpio constants rather than using enum.
Fix pull-up and pull-down values of gpio.
According to A10 user manual possible pull register
values are 00 Pull-up/down disable, 01 Pull-up, 10 Pull-down.
Approved by: gonzo@
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/allwinner/a10_gpio.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/arm/allwinner/a10_gpio.c b/sys/arm/allwinner/a10_gpio.c index b70d036..bc0d92a 100644 --- a/sys/arm/allwinner/a10_gpio.c +++ b/sys/arm/allwinner/a10_gpio.c @@ -66,6 +66,13 @@ __FBSDID("$FreeBSD$"); #define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) +#define A10_GPIO_NONE 0 +#define A10_GPIO_PULLUP 1 +#define A10_GPIO_PULLDOWN 2 + +#define A10_GPIO_INPUT 0 +#define A10_GPIO_OUTPUT 1 + struct a10_gpio_softc { device_t sc_dev; struct mtx sc_mtx; @@ -78,17 +85,6 @@ struct a10_gpio_softc { struct gpio_pin sc_gpio_pins[A10_GPIO_PINS]; }; -enum a10_gpio_fsel { - A10_GPIO_INPUT, - A10_GPIO_OUTPUT, -}; - -enum a10_gpio_pud { - A10_GPIO_NONE, - A10_GPIO_PULLDOWN, - A10_GPIO_PULLUP, -}; - #define A10_GPIO_LOCK(_sc) mtx_lock(&_sc->sc_mtx) #define A10_GPIO_UNLOCK(_sc) mtx_unlock(&_sc->sc_mtx) #define A10_GPIO_LOCK_ASSERT(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) |