Lines Matching +full:generic +full:- +full:ehci
1 /*-
32 * Generic EHCI driver based on the Allwinner A10 EHCI driver
57 #include <dev/usb/controller/ehci.h>
70 sc->sc_bus.parent = self; in generic_ehci_attach()
71 sc->sc_bus.devices = sc->sc_devices; in generic_ehci_attach()
72 sc->sc_bus.devices_max = EHCI_MAX_DEVICES; in generic_ehci_attach()
73 sc->sc_bus.dma_bits = 32; in generic_ehci_attach()
76 if (usb_bus_mem_alloc_all(&sc->sc_bus, in generic_ehci_attach()
81 sc->sc_bus.usbrev = USB_REV_2_0; in generic_ehci_attach()
84 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, in generic_ehci_attach()
86 if (!sc->sc_io_res) { in generic_ehci_attach()
91 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); in generic_ehci_attach()
92 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); in generic_ehci_attach()
93 sc->sc_io_size = rman_get_size(sc->sc_io_res); in generic_ehci_attach()
96 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, in generic_ehci_attach()
98 if (sc->sc_irq_res == NULL) { in generic_ehci_attach()
102 sc->sc_bus.bdev = device_add_child(self, "usbus", DEVICE_UNIT_ANY); in generic_ehci_attach()
103 if (!sc->sc_bus.bdev) { in generic_ehci_attach()
107 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); in generic_ehci_attach()
109 strlcpy(sc->sc_vendor, "Generic", sizeof(sc->sc_vendor)); in generic_ehci_attach()
111 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in generic_ehci_attach()
112 NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); in generic_ehci_attach()
115 sc->sc_intr_hdl = NULL; in generic_ehci_attach()
119 sc->sc_flags |= EHCI_SCFLG_DONTRESET; in generic_ehci_attach()
123 err = device_probe_and_attach(sc->sc_bus.bdev); in generic_ehci_attach()
145 if (sc->sc_irq_res && sc->sc_intr_hdl) { in generic_ehci_detach()
151 err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); in generic_ehci_detach()
157 sc->sc_intr_hdl = NULL; in generic_ehci_detach()
160 if (sc->sc_irq_res) { in generic_ehci_detach()
161 bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); in generic_ehci_detach()
162 sc->sc_irq_res = NULL; in generic_ehci_detach()
164 if (sc->sc_io_res) { in generic_ehci_detach()
166 sc->sc_io_res); in generic_ehci_detach()
167 sc->sc_io_res = NULL; in generic_ehci_detach()
169 usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); in generic_ehci_detach()
186 .name = "ehci",