Lines Matching defs:sc_otg

67 	struct musbotg_softc sc_otg;	/* must be first */
76 musbotg_vbus_interrupt(&sc->sc_otg, vbus_val);
132 sc->sc_otg.sc_clocks_on = &musbotg_clocks_on;
133 sc->sc_otg.sc_clocks_off = &musbotg_clocks_off;
134 sc->sc_otg.sc_clocks_arg = sc;
137 sc->sc_otg.sc_bus.parent = dev;
138 sc->sc_otg.sc_bus.devices = sc->sc_otg.sc_devices;
139 sc->sc_otg.sc_bus.devices_max = MUSB2_MAX_DEVICES;
140 sc->sc_otg.sc_bus.dma_bits = 32;
143 if (usb_bus_mem_alloc_all(&sc->sc_otg.sc_bus,
148 sc->sc_otg.sc_io_res =
151 if (!(sc->sc_otg.sc_io_res)) {
155 sc->sc_otg.sc_io_tag = rman_get_bustag(sc->sc_otg.sc_io_res);
156 sc->sc_otg.sc_io_hdl = rman_get_bushandle(sc->sc_otg.sc_io_res);
157 sc->sc_otg.sc_io_size = rman_get_size(sc->sc_otg.sc_io_res);
160 sc->sc_otg.sc_irq_res =
162 if (!(sc->sc_otg.sc_irq_res)) {
165 sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1);
166 if (!(sc->sc_otg.sc_bus.bdev)) {
169 device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus);
171 sc->sc_otg.sc_id = 0;
172 sc->sc_otg.sc_platform_data = sc;
173 sc->sc_otg.sc_mode = MUSB2_DEVICE_MODE;
176 err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
177 NULL, (driver_intr_t *)musbotg_wrapper_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
179 err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
180 (driver_intr_t *)musbotg_wrapper_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
183 sc->sc_otg.sc_intr_hdl = NULL;
186 err = musbotg_init(&sc->sc_otg);
188 err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev);
210 if (sc->sc_otg.sc_bus.bdev) {
211 bdev = sc->sc_otg.sc_bus.bdev;
218 if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) {
222 musbotg_uninit(&sc->sc_otg);
224 err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res,
225 sc->sc_otg.sc_intr_hdl);
226 sc->sc_otg.sc_intr_hdl = NULL;
229 if (sc->sc_otg.sc_irq_res) {
231 sc->sc_otg.sc_irq_res);
232 sc->sc_otg.sc_irq_res = NULL;
235 if (sc->sc_otg.sc_io_res) {
237 sc->sc_otg.sc_io_res);
238 sc->sc_otg.sc_io_res = NULL;
240 usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);