1/*- 2 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/dev/usb/controller/musb_otg_atmelarm.c 228483 2011-12-14 00:28:54Z hselasky $"); |
28 29#include <sys/stdint.h> 30#include <sys/stddef.h> 31#include <sys/param.h> 32#include <sys/queue.h> 33#include <sys/types.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> --- 21 unchanged lines hidden (view full) --- 57#include <dev/usb/usb_bus.h> 58#include <dev/usb/controller/musb_otg.h> 59 60#include <sys/rman.h> 61 62static device_probe_t musbotg_probe; 63static device_attach_t musbotg_attach; 64static device_detach_t musbotg_detach; |
65 66struct musbotg_super_softc { 67 struct musbotg_softc sc_otg; /* must be first */ 68}; 69 70static void 71musbotg_vbus_poll(struct musbotg_super_softc *sc) 72{ --- 139 unchanged lines hidden (view full) --- 212 sc->sc_otg.sc_io_res); 213 sc->sc_otg.sc_io_res = NULL; 214 } 215 usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL); 216 217 return (0); 218} 219 |
220static device_method_t musbotg_methods[] = { 221 /* Device interface */ 222 DEVMETHOD(device_probe, musbotg_probe), 223 DEVMETHOD(device_attach, musbotg_attach), 224 DEVMETHOD(device_detach, musbotg_detach), |
225 DEVMETHOD(device_suspend, bus_generic_suspend), 226 DEVMETHOD(device_resume, bus_generic_resume), 227 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
228 229 DEVMETHOD_END 230}; 231 232static driver_t musbotg_driver = { |
233 .name = "musbotg", 234 .methods = musbotg_methods, 235 .size = sizeof(struct musbotg_super_softc), |
236}; 237 238static devclass_t musbotg_devclass; 239 240DRIVER_MODULE(musbotg, atmelarm, musbotg_driver, musbotg_devclass, 0, 0); 241MODULE_DEPEND(musbotg, usb, 1, 1, 1); |