imx_gpio.c (273799) | imx_gpio.c (274670) |
---|---|
1/*- 2 * Copyright (c) 2012, 2013 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> | 1/*- 2 * Copyright (c) 2012, 2013 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/imx_gpio.c 273799 2014-10-28 18:33:59Z loos $"); | 35__FBSDID("$FreeBSD: head/sys/arm/freescale/imx/imx_gpio.c 274670 2014-11-18 17:22:08Z loos $"); |
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> --- 219 unchanged lines hidden (view full) --- 263 for (i = 0; i < sc->gpio_npins; i++) { 264 if (sc->gpio_pins[i].gp_pin == pin) 265 break; 266 } 267 268 if (i >= sc->gpio_npins) 269 return (EINVAL); 270 | 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> --- 219 unchanged lines hidden (view full) --- 263 for (i = 0; i < sc->gpio_npins; i++) { 264 if (sc->gpio_pins[i].gp_pin == pin) 265 break; 266 } 267 268 if (i >= sc->gpio_npins) 269 return (EINVAL); 270 |
271 /* Check for unwanted flags. */ 272 if ((flags & sc->gpio_pins[i].gp_caps) != flags) 273 return (EINVAL); 274 275 /* Can't mix input/output together */ 276 if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 277 (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) 278 return (EINVAL); 279 | |
280 imx51_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); 281 | 271 imx51_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); 272 |
282 | |
283 return (0); 284} 285 286static int 287imx51_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) 288{ 289 struct imx51_gpio_softc *sc; 290 int i; --- 201 unchanged lines hidden --- | 273 return (0); 274} 275 276static int 277imx51_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) 278{ 279 struct imx51_gpio_softc *sc; 280 int i; --- 201 unchanged lines hidden --- |