a10_gpio.c (246955) | a10_gpio.c (249449) |
---|---|
1/*- 2 * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@gmail.com> 3 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org> 4 * Copyright (c) 2012 Luiz Otavio O Souza. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 */ 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@gmail.com> 3 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org> 4 * Copyright (c) 2012 Luiz Otavio O Souza. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 */ 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/arm/allwinner/a10_gpio.c 246955 2013-02-19 02:01:35Z ganbold $"); | 30__FBSDID("$FreeBSD: head/sys/arm/allwinner/a10_gpio.c 249449 2013-04-13 21:21:13Z dim $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35 36#include <sys/kernel.h> 37#include <sys/module.h> 38#include <sys/rman.h> --- 256 unchanged lines hidden (view full) --- 295 for (i = 0; i < sc->sc_gpio_npins; i++) { 296 if (sc->sc_gpio_pins[i].gp_pin == pin) 297 break; 298 } 299 300 if (i >= sc->sc_gpio_npins) 301 return (EINVAL); 302 | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35 36#include <sys/kernel.h> 37#include <sys/module.h> 38#include <sys/rman.h> --- 256 unchanged lines hidden (view full) --- 295 for (i = 0; i < sc->sc_gpio_npins; i++) { 296 if (sc->sc_gpio_pins[i].gp_pin == pin) 297 break; 298 } 299 300 if (i >= sc->sc_gpio_npins) 301 return (EINVAL); 302 |
303 /* Filter out unwanted flags. */ 304 if ((flags &= sc->sc_gpio_pins[i].gp_caps) != flags) | 303 /* Check for unwanted flags. */ 304 if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) |
305 return (EINVAL); 306 307 /* Can't mix input/output together. */ 308 if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 309 (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) 310 return (EINVAL); 311 312 /* Can't mix pull-up/pull-down together. */ --- 205 unchanged lines hidden --- | 305 return (EINVAL); 306 307 /* Can't mix input/output together. */ 308 if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 309 (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) 310 return (EINVAL); 311 312 /* Can't mix pull-up/pull-down together. */ --- 205 unchanged lines hidden --- |