bcm2835_gpio.c (261077) | bcm2835_gpio.c (266105) |
---|---|
1/*- 2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org> 3 * Copyright (c) 2012 Luiz Otavio O Souza. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org> 3 * Copyright (c) 2012 Luiz Otavio O Souza. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c 261077 2014-01-23 12:02:04Z loos $"); | 29__FBSDID("$FreeBSD: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c 266105 2014-05-15 01:27:53Z loos $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bus.h> 34 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/rman.h> --- 719 unchanged lines hidden (view full) --- 757 758static int 759bcm_gpio_detach(device_t dev) 760{ 761 762 return (EBUSY); 763} 764 | 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bus.h> 34 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/rman.h> --- 719 unchanged lines hidden (view full) --- 757 758static int 759bcm_gpio_detach(device_t dev) 760{ 761 762 return (EBUSY); 763} 764 |
765static phandle_t 766bcm_gpio_get_node(device_t bus, device_t dev) 767{ 768 769 /* We only have one child, the GPIO bus, which needs our own node. */ 770 return (ofw_bus_get_node(bus)); 771} 772 |
|
765static device_method_t bcm_gpio_methods[] = { 766 /* Device interface */ 767 DEVMETHOD(device_probe, bcm_gpio_probe), 768 DEVMETHOD(device_attach, bcm_gpio_attach), 769 DEVMETHOD(device_detach, bcm_gpio_detach), 770 771 /* GPIO protocol */ 772 DEVMETHOD(gpio_pin_max, bcm_gpio_pin_max), 773 DEVMETHOD(gpio_pin_getname, bcm_gpio_pin_getname), 774 DEVMETHOD(gpio_pin_getflags, bcm_gpio_pin_getflags), 775 DEVMETHOD(gpio_pin_getcaps, bcm_gpio_pin_getcaps), 776 DEVMETHOD(gpio_pin_setflags, bcm_gpio_pin_setflags), 777 DEVMETHOD(gpio_pin_get, bcm_gpio_pin_get), 778 DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set), 779 DEVMETHOD(gpio_pin_toggle, bcm_gpio_pin_toggle), 780 | 773static device_method_t bcm_gpio_methods[] = { 774 /* Device interface */ 775 DEVMETHOD(device_probe, bcm_gpio_probe), 776 DEVMETHOD(device_attach, bcm_gpio_attach), 777 DEVMETHOD(device_detach, bcm_gpio_detach), 778 779 /* GPIO protocol */ 780 DEVMETHOD(gpio_pin_max, bcm_gpio_pin_max), 781 DEVMETHOD(gpio_pin_getname, bcm_gpio_pin_getname), 782 DEVMETHOD(gpio_pin_getflags, bcm_gpio_pin_getflags), 783 DEVMETHOD(gpio_pin_getcaps, bcm_gpio_pin_getcaps), 784 DEVMETHOD(gpio_pin_setflags, bcm_gpio_pin_setflags), 785 DEVMETHOD(gpio_pin_get, bcm_gpio_pin_get), 786 DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set), 787 DEVMETHOD(gpio_pin_toggle, bcm_gpio_pin_toggle), 788 |
789 /* ofw_bus interface */ 790 DEVMETHOD(ofw_bus_get_node, bcm_gpio_get_node), 791 |
|
781 DEVMETHOD_END 782}; 783 784static devclass_t bcm_gpio_devclass; 785 786static driver_t bcm_gpio_driver = { 787 "gpio", 788 bcm_gpio_methods, 789 sizeof(struct bcm_gpio_softc), 790}; 791 792DRIVER_MODULE(bcm_gpio, simplebus, bcm_gpio_driver, bcm_gpio_devclass, 0, 0); | 792 DEVMETHOD_END 793}; 794 795static devclass_t bcm_gpio_devclass; 796 797static driver_t bcm_gpio_driver = { 798 "gpio", 799 bcm_gpio_methods, 800 sizeof(struct bcm_gpio_softc), 801}; 802 803DRIVER_MODULE(bcm_gpio, simplebus, bcm_gpio_driver, bcm_gpio_devclass, 0, 0); |