Lines Matching refs:dev
29 __FBSDID("$FreeBSD: releng/11.0/sys/dev/usb/controller/xhci_mv.c 296827 2016-03-14 07:24:08Z wma $");
51 #include <dev/ofw/ofw_bus.h>
52 #include <dev/ofw/ofw_bus_subr.h>
54 #include <dev/usb/usb.h>
55 #include <dev/usb/usbdi.h>
57 #include <dev/usb/usb_core.h>
58 #include <dev/usb/usb_busdma.h>
59 #include <dev/usb/usb_process.h>
60 #include <dev/usb/usb_util.h>
62 #include <dev/usb/usb_controller.h>
63 #include <dev/usb/usb_bus.h>
64 #include <dev/usb/controller/xhci.h>
65 #include <dev/usb/controller/xhcireg.h>
81 xhci_probe(device_t dev)
84 if (!ofw_bus_status_okay(dev))
87 if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
90 device_set_desc(dev, XHCI_HC_DEVSTR);
96 xhci_attach(device_t dev)
98 struct xhci_softc *sc = device_get_softc(dev);
101 sc->sc_bus.parent = dev;
105 sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
108 device_printf(dev, "Failed to map memory\n");
109 xhci_detach(dev);
117 sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
120 device_printf(dev, "Failed to allocate IRQ\n");
121 xhci_detach(dev);
125 sc->sc_bus.bdev = device_add_child(dev, "usbus", -1);
127 device_printf(dev, "Failed to add USB device\n");
128 xhci_detach(dev);
137 err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
140 device_printf(dev, "Failed to setup error IRQ, %d\n", err);
142 xhci_detach(dev);
146 err = xhci_init(sc, dev, IS_DMA_32B);
148 device_printf(dev, "Failed to init XHCI, with error %d\n", err);
149 xhci_detach(dev);
155 device_printf(dev, "Failed to start XHCI controller, with error %d\n", err);
156 xhci_detach(dev);
162 device_printf(dev, "Failed to initialize USB, with error %d\n", err);
163 xhci_detach(dev);
171 xhci_detach(device_t dev)
173 struct xhci_softc *sc = device_get_softc(dev);
180 device_delete_child(dev, bdev);
184 device_delete_children(dev);
187 err = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl);
189 device_printf(dev, "Could not tear down irq, %d\n",
195 bus_release_resource(dev, SYS_RES_IRQ,
201 bus_release_resource(dev, SYS_RES_MEMORY,