zy7_gpio.c (266152) | zy7_gpio.c (278782) |
---|---|
1/*- 2 * Copyright (c) 2013 Thomas Skibo 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2013 Thomas Skibo 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: stable/10/sys/arm/xilinx/zy7_gpio.c 266152 2014-05-15 16:11:06Z ian $ | 26 * $FreeBSD: stable/10/sys/arm/xilinx/zy7_gpio.c 278782 2015-02-14 20:37:33Z loos $ |
27 */ 28 29/* 30 * A GPIO driver for Xilinx Zynq-7000. 31 * 32 * The GPIO peripheral on Zynq allows controlling 114 general purpose I/Os. 33 * 34 * Pins 53-0 are sent to the MIO. Any MIO pins not used by a PS peripheral are --- 4 unchanged lines hidden (view full) --- 39 * gpio framework doesn't seem to have hooks for this. 40 * 41 * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. 42 * (v1.4) November 16, 2012. Xilinx doc UG585. GPIO is covered in 43 * chater 14. Register definitions are in appendix B.19. 44 */ 45 46#include <sys/cdefs.h> | 27 */ 28 29/* 30 * A GPIO driver for Xilinx Zynq-7000. 31 * 32 * The GPIO peripheral on Zynq allows controlling 114 general purpose I/Os. 33 * 34 * Pins 53-0 are sent to the MIO. Any MIO pins not used by a PS peripheral are --- 4 unchanged lines hidden (view full) --- 39 * gpio framework doesn't seem to have hooks for this. 40 * 41 * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. 42 * (v1.4) November 16, 2012. Xilinx doc UG585. GPIO is covered in 43 * chater 14. Register definitions are in appendix B.19. 44 */ 45 46#include <sys/cdefs.h> |
47__FBSDID("$FreeBSD: stable/10/sys/arm/xilinx/zy7_gpio.c 266152 2014-05-15 16:11:06Z ian $"); | 47__FBSDID("$FreeBSD: stable/10/sys/arm/xilinx/zy7_gpio.c 278782 2015-02-14 20:37:33Z loos $"); |
48 49#include <sys/param.h> 50#include <sys/systm.h> 51#include <sys/conf.h> 52#include <sys/bus.h> 53#include <sys/kernel.h> 54#include <sys/module.h> 55#include <sys/lock.h> --- 268 unchanged lines hidden (view full) --- 324 device_printf(dev, "Can't allocate memory for device"); 325 zy7_gpio_detach(dev); 326 return (ENOMEM); 327 } 328 329 /* Completely reset. */ 330 zy7_gpio_hw_reset(sc); 331 | 48 49#include <sys/param.h> 50#include <sys/systm.h> 51#include <sys/conf.h> 52#include <sys/bus.h> 53#include <sys/kernel.h> 54#include <sys/module.h> 55#include <sys/lock.h> --- 268 unchanged lines hidden (view full) --- 324 device_printf(dev, "Can't allocate memory for device"); 325 zy7_gpio_detach(dev); 326 return (ENOMEM); 327 } 328 329 /* Completely reset. */ 330 zy7_gpio_hw_reset(sc); 331 |
332 device_add_child(dev, "gpioc", device_get_unit(dev)); 333 device_add_child(dev, "gpiobus", device_get_unit(dev)); | 332 device_add_child(dev, "gpioc", -1); 333 device_add_child(dev, "gpiobus", -1); |
334 335 return (bus_generic_attach(dev)); 336} 337 338static int 339zy7_gpio_detach(device_t dev) 340{ 341 struct zy7_gpio_softc *sc = device_get_softc(dev); --- 47 unchanged lines hidden --- | 334 335 return (bus_generic_attach(dev)); 336} 337 338static int 339zy7_gpio_detach(device_t dev) 340{ 341 struct zy7_gpio_softc *sc = device_get_softc(dev); --- 47 unchanged lines hidden --- |