Deleted Added
full compact
wii_gpio.c (256281) wii_gpio.c (278782)
1/*-
2 * Copyright (C) 2012 Margarida Gouveia
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

--- 10 unchanged lines hidden (view full) ---

19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 * 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#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 2012 Margarida Gouveia
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

--- 10 unchanged lines hidden (view full) ---

19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 * 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#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: stable/10/sys/powerpc/wii/wii_gpio.c 250788 2013-05-18 19:30:42Z rpaulo $");
27__FBSDID("$FreeBSD: stable/10/sys/powerpc/wii/wii_gpio.c 278782 2015-02-14 20:37:33Z loos $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>

--- 141 unchanged lines hidden (view full) ---

177#ifdef WIIGPIO_DEBUG
178 device_printf(dev, "PIN %d state %d flag %s\n", i,
179 wiigpio_read(sc, WIIGPIO_PINBANK(i)) >>
180 (i % (WIIGPIO_NPINS / 2)) & 1,
181 sc->sc_pins[i].gp_flags == GPIO_PIN_INPUT ?
182 "GPIO_PIN_INPUT" : "GPIO_PIN_OUTPUT");
183#endif
184 }
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>

--- 141 unchanged lines hidden (view full) ---

177#ifdef WIIGPIO_DEBUG
178 device_printf(dev, "PIN %d state %d flag %s\n", i,
179 wiigpio_read(sc, WIIGPIO_PINBANK(i)) >>
180 (i % (WIIGPIO_NPINS / 2)) & 1,
181 sc->sc_pins[i].gp_flags == GPIO_PIN_INPUT ?
182 "GPIO_PIN_INPUT" : "GPIO_PIN_OUTPUT");
183#endif
184 }
185 device_add_child(dev, "gpioc", device_get_unit(dev));
186 device_add_child(dev, "gpiobus", device_get_unit(dev));
185 device_add_child(dev, "gpioc", -1);
186 device_add_child(dev, "gpiobus", -1);
187 /*
188 * We will be responsible for powering off the system.
189 */
190 EVENTHANDLER_REGISTER(shutdown_final, wiigpio_shutdown, dev,
191 SHUTDOWN_PRI_LAST);
192
193 return (bus_generic_attach(dev));
194}

--- 164 unchanged lines hidden ---
187 /*
188 * We will be responsible for powering off the system.
189 */
190 EVENTHANDLER_REGISTER(shutdown_final, wiigpio_shutdown, dev,
191 SHUTDOWN_PRI_LAST);
192
193 return (bus_generic_attach(dev));
194}

--- 164 unchanged lines hidden ---