Lines Matching defs:sc_otg

67 	struct atmegadci_softc sc_otg;	/* must be first */
97 sc->sc_otg.sc_clocks_on = &atmegadci_clocks_on;
98 sc->sc_otg.sc_clocks_off = &atmegadci_clocks_off;
101 sc->sc_otg.sc_bus.parent = dev;
102 sc->sc_otg.sc_bus.devices = sc->sc_otg.sc_devices;
103 sc->sc_otg.sc_bus.devices_max = ATMEGA_MAX_DEVICES;
104 sc->sc_otg.sc_bus.dma_bits = 32;
107 if (usb_bus_mem_alloc_all(&sc->sc_otg.sc_bus,
112 sc->sc_otg.sc_io_res =
115 if (!(sc->sc_otg.sc_io_res)) {
119 sc->sc_otg.sc_io_tag = rman_get_bustag(sc->sc_otg.sc_io_res);
120 sc->sc_otg.sc_io_hdl = rman_get_bushandle(sc->sc_otg.sc_io_res);
123 sc->sc_otg.sc_irq_res =
125 if (!(sc->sc_otg.sc_irq_res)) {
128 sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1);
129 if (!(sc->sc_otg.sc_bus.bdev)) {
132 device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus);
134 err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
135 NULL, (driver_intr_t *)atmegadci_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
137 sc->sc_otg.sc_intr_hdl = NULL;
140 err = atmegadci_init(&sc->sc_otg);
142 err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev);
161 if (sc->sc_otg.sc_bus.bdev) {
162 bdev = sc->sc_otg.sc_bus.bdev;
169 if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) {
173 atmegadci_uninit(&sc->sc_otg);
175 err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res,
176 sc->sc_otg.sc_intr_hdl);
177 sc->sc_otg.sc_intr_hdl = NULL;
180 if (sc->sc_otg.sc_irq_res) {
182 sc->sc_otg.sc_irq_res);
183 sc->sc_otg.sc_irq_res = NULL;
186 if (sc->sc_otg.sc_io_res) {
188 sc->sc_otg.sc_io_res);
189 sc->sc_otg.sc_io_res = NULL;
191 usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);