summaryrefslogtreecommitdiffstats
path: root/sys/arm/allwinner
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2015-02-14 21:16:19 +0000
committerloos <loos@FreeBSD.org>2015-02-14 21:16:19 +0000
commita7a8c39e00df26eda21597ddbe0f587ced4375a8 (patch)
treea2bdaaa92bec82c663e0a841ddfdce165ac2ebf1 /sys/arm/allwinner
parentfd8cd0a9634bc701a7e4e2431a43432b23767400 (diff)
downloadFreeBSD-src-a7a8c39e00df26eda21597ddbe0f587ced4375a8.zip
FreeBSD-src-a7a8c39e00df26eda21597ddbe0f587ced4375a8.tar.gz
MFC r274670, r274671, r276168:
Moves all the duplicate code to a single function. Verify for invalid modes and unwanted flags before pass the new flags to driver. Make gpio_default_map_gpios() static. No functional changes. Improves the GPIO API description a little bit. gpio_pin_max must return the maximum supported pin number and not the total number of pins on the system.
Diffstat (limited to 'sys/arm/allwinner')
-rw-r--r--sys/arm/allwinner/a10_gpio.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/sys/arm/allwinner/a10_gpio.c b/sys/arm/allwinner/a10_gpio.c
index a532106..23bf399 100644
--- a/sys/arm/allwinner/a10_gpio.c
+++ b/sys/arm/allwinner/a10_gpio.c
@@ -302,20 +302,6 @@ a10_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags)
if (i >= sc->sc_gpio_npins)
return (EINVAL);
- /* Check for unwanted flags. */
- if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags)
- return (EINVAL);
-
- /* Can't mix input/output together. */
- if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) ==
- (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT))
- return (EINVAL);
-
- /* Can't mix pull-up/pull-down together. */
- if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) ==
- (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN))
- return (EINVAL);
-
a10_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags);
return (0);
OpenPOWER on IntegriCloud