1/*- 2 * Copyright (c) 2012 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Oleksandr Rybalko under sponsorship 6 * from the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * SUCH DAMAGE. 28 */ 29 30/* 31 * Freescale i.MX515 GPIO driver. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/arm/freescale/imx/imx51_gpio.c 249449 2013-04-13 21:21:13Z dim $"); |
36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/bus.h> 40 41#include <sys/kernel.h> 42#include <sys/module.h> 43#include <sys/rman.h> --- 212 unchanged lines hidden (view full) --- 256 for (i = 0; i < sc->gpio_npins; i++) { 257 if (sc->gpio_pins[i].gp_pin == pin) 258 break; 259 } 260 261 if (i >= sc->gpio_npins) 262 return (EINVAL); 263 |
264 /* Check for unwanted flags. */ 265 if ((flags & sc->gpio_pins[i].gp_caps) != flags) |
266 return (EINVAL); 267 268 /* Can't mix input/output together */ 269 if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 270 (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) 271 return (EINVAL); 272 273 imx51_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); --- 208 unchanged lines hidden --- |