Lines Matching refs:sc

71 musbotg_vbus_poll(struct musbotg_super_softc *sc)
76 musbotg_vbus_interrupt(&sc->sc_otg, vbus_val);
83 struct musbotg_super_softc *sc = arg;
92 struct musbotg_super_softc *sc = arg;
109 musbotg_ep_int_set(struct musbotg_softc *sc, int ep, int on)
127 struct musbotg_super_softc *sc = device_get_softc(dev);
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);
194 musbotg_vbus_poll(sc);
206 struct musbotg_super_softc *sc = device_get_softc(dev);
212 if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) {
216 musbotg_uninit(&sc->sc_otg);
218 err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res,
219 sc->sc_otg.sc_intr_hdl);
220 sc->sc_otg.sc_intr_hdl = NULL;
223 if (sc->sc_otg.sc_irq_res) {
225 sc->sc_otg.sc_irq_res);
226 sc->sc_otg.sc_irq_res = NULL;
229 if (sc->sc_otg.sc_io_res) {
231 sc->sc_otg.sc_io_res);
232 sc->sc_otg.sc_io_res = NULL;
234 usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);