Lines Matching refs:musb

33 			struct musb *musb, struct musb_ep *musb_ep)  in map_dma_buffer()  argument
36 struct dma_controller *dma = musb->dma_controller; in map_dma_buffer()
59 musb->controller, in map_dma_buffer()
65 ret = dma_mapping_error(musb->controller, dma_addr); in map_dma_buffer()
72 dma_sync_single_for_device(musb->controller, in map_dma_buffer()
84 struct musb *musb) in unmap_dma_buffer() argument
92 dev_vdbg(musb->controller, in unmap_dma_buffer()
97 dma_unmap_single(musb->controller, in unmap_dma_buffer()
105 dma_sync_single_for_cpu(musb->controller, in unmap_dma_buffer()
126 __releases(ep->musb->lock) in musb_g_giveback()
127 __acquires(ep->musb->lock) in musb_g_giveback()
130 struct musb *musb; in musb_g_giveback() local
138 musb = req->musb; in musb_g_giveback()
141 spin_unlock(&musb->lock); in musb_g_giveback()
143 if (!dma_mapping_error(&musb->g.dev, request->dma)) in musb_g_giveback()
144 unmap_dma_buffer(req, musb); in musb_g_giveback()
148 spin_lock(&musb->lock); in musb_g_giveback()
160 struct musb *musb = ep->musb; in nuke() local
162 void __iomem *epio = ep->musb->endpoints[ep->current_epnum].regs; in nuke()
167 struct dma_controller *c = ep->musb->dma_controller; in nuke()
188 musb_dbg(musb, "%s: abort DMA --> %d", ep->name, value); in nuke()
208 static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) in max_ep_writesize() argument
210 if (can_bulk_split(musb, ep->type)) in max_ep_writesize()
223 static void txstate(struct musb *musb, struct musb_request *req) in txstate() argument
227 void __iomem *epio = musb->endpoints[epnum].regs; in txstate()
236 musb_dbg(musb, "ep:%s disabled - ignore request", in txstate()
243 musb_dbg(musb, "dma pending..."); in txstate()
251 fifo_count = min(max_ep_writesize(musb, musb_ep), in txstate()
255 musb_dbg(musb, "%s old packet still ready , txcsr %03x", in txstate()
261 musb_dbg(musb, "%s stalling, txcsr %03x", in txstate()
266 musb_dbg(musb, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x", in txstate()
272 struct dma_controller *c = musb->dma_controller; in txstate()
283 if (musb_dma_inventra(musb) || musb_dma_ux500(musb)) { in txstate()
323 can_bulk_split(musb, in txstate()
333 if (is_cppi_enabled(musb)) { in txstate()
369 } else if (tusb_dma_omap(musb)) in txstate()
383 unmap_dma_buffer(req, musb); in txstate()
394 musb_dbg(musb, "%s TX/IN %s len %d/%d, txcsr %04x, fifo %d/%d", in txstate()
406 void musb_g_tx(struct musb *musb, u8 epnum) in musb_g_tx() argument
411 u8 __iomem *mbase = musb->mregs; in musb_g_tx()
412 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; in musb_g_tx()
413 void __iomem *epio = musb->endpoints[epnum].regs; in musb_g_tx()
421 musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); in musb_g_tx()
441 dev_vdbg(musb->controller, "underrun on ep%d, req %p\n", in musb_g_tx()
450 musb_dbg(musb, "%s dma still busy?", musb_ep->end_point.name); in musb_g_tx()
466 musb_dbg(musb, "TXCSR%d %04x, DMA off, len %zu, req %p", in musb_g_tx()
503 musb_dbg(musb, "%s idle now", in musb_g_tx()
509 txstate(musb, req); in musb_g_tx()
518 static void rxstate(struct musb *musb, struct musb_request *req) in rxstate() argument
523 void __iomem *epio = musb->endpoints[epnum].regs; in rxstate()
527 struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; in rxstate()
539 musb_dbg(musb, "ep:%s disabled - ignore request", in rxstate()
546 musb_dbg(musb, "DMA pending..."); in rxstate()
551 musb_dbg(musb, "%s stalling, RXCSR %04x", in rxstate()
556 if (is_cppi_enabled(musb) && is_buffer_mapped(req)) { in rxstate()
557 struct dma_controller *c = musb->dma_controller; in rxstate()
601 if (musb_dma_inventra(musb)) { in rxstate()
607 c = musb->dma_controller; in rxstate()
676 if ((musb_dma_ux500(musb)) && in rxstate()
683 c = musb->dma_controller; in rxstate()
726 musb_dbg(musb, "%s OUT/RX pio fifo %d/%d, maxpacket %d", in rxstate()
733 if (tusb_dma_omap(musb)) { in rxstate()
734 struct dma_controller *c = musb->dma_controller; in rxstate()
753 unmap_dma_buffer(req, musb); in rxstate()
790 void musb_g_rx(struct musb *musb, u8 epnum) in musb_g_rx() argument
795 void __iomem *mbase = musb->mregs; in musb_g_rx()
797 void __iomem *epio = musb->endpoints[epnum].regs; in musb_g_rx()
799 struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; in musb_g_rx()
818 musb_dbg(musb, "<== %s, rxcsr %04x%s %p", musb_ep->end_point.name, in musb_g_rx()
833 musb_dbg(musb, "%s iso overrun on %p", musb_ep->name, request); in musb_g_rx()
839 musb_dbg(musb, "%s, incomprx", musb_ep->end_point.name); in musb_g_rx()
844 musb_dbg(musb, "%s busy, csr %04x", in musb_g_rx()
903 rxstate(musb, req); in musb_g_rx()
915 struct musb *musb; in musb_gadget_enable() local
928 musb = musb_ep->musb; in musb_gadget_enable()
929 mbase = musb->mregs; in musb_gadget_enable()
932 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_enable()
950 ok = musb->hb_iso_tx; in musb_gadget_enable()
952 ok = musb->hb_iso_rx; in musb_gadget_enable()
955 musb_dbg(musb, "no support for high bandwidth ISO"); in musb_gadget_enable()
978 musb_dbg(musb, "packet size beyond hardware FIFO size"); in musb_gadget_enable()
982 musb->intrtxe |= (1 << epnum); in musb_gadget_enable()
983 musb_writew(mbase, MUSB_INTRTXE, musb->intrtxe); in musb_gadget_enable()
991 if (can_bulk_split(musb, musb_ep->type)) in musb_gadget_enable()
1017 musb_dbg(musb, "packet size beyond hardware FIFO size"); in musb_gadget_enable()
1021 musb->intrrxe |= (1 << epnum); in musb_gadget_enable()
1022 musb_writew(mbase, MUSB_INTRRXE, musb->intrrxe); in musb_gadget_enable()
1054 if (is_dma_capable() && musb->dma_controller) { in musb_gadget_enable()
1055 struct dma_controller *c = musb->dma_controller; in musb_gadget_enable()
1074 schedule_delayed_work(&musb->irq_work, 0); in musb_gadget_enable()
1077 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_enable()
1087 struct musb *musb; in musb_gadget_disable() local
1093 musb = musb_ep->musb; in musb_gadget_disable()
1095 epio = musb->endpoints[epnum].regs; in musb_gadget_disable()
1097 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_disable()
1098 musb_ep_select(musb->mregs, epnum); in musb_gadget_disable()
1102 musb->intrtxe &= ~(1 << epnum); in musb_gadget_disable()
1103 musb_writew(musb->mregs, MUSB_INTRTXE, musb->intrtxe); in musb_gadget_disable()
1106 musb->intrrxe &= ~(1 << epnum); in musb_gadget_disable()
1107 musb_writew(musb->mregs, MUSB_INTRRXE, musb->intrrxe); in musb_gadget_disable()
1117 schedule_delayed_work(&musb->irq_work, 0); in musb_gadget_disable()
1119 spin_unlock_irqrestore(&(musb->lock), flags); in musb_gadget_disable()
1121 musb_dbg(musb, "%s", musb_ep->end_point.name); in musb_gadget_disable()
1171 void musb_ep_restart(struct musb *musb, struct musb_request *req) in musb_ep_restart() argument
1174 musb_ep_select(musb->mregs, req->epnum); in musb_ep_restart()
1176 txstate(musb, req); in musb_ep_restart()
1178 rxstate(musb, req); in musb_ep_restart()
1181 static int musb_ep_restart_resume_work(struct musb *musb, void *data) in musb_ep_restart_resume_work() argument
1185 musb_ep_restart(musb, req); in musb_ep_restart_resume_work()
1195 struct musb *musb; in musb_gadget_queue() local
1205 musb = musb_ep->musb; in musb_gadget_queue()
1208 request->musb = musb; in musb_gadget_queue()
1213 status = pm_runtime_get(musb->controller); in musb_gadget_queue()
1215 dev_err(musb->controller, in musb_gadget_queue()
1218 pm_runtime_put_noidle(musb->controller); in musb_gadget_queue()
1232 map_dma_buffer(request, musb, musb_ep); in musb_gadget_queue()
1234 spin_lock_irqsave(&musb->lock, lockflags); in musb_gadget_queue()
1238 musb_dbg(musb, "req %p queued to %s while ep %s", in musb_gadget_queue()
1241 unmap_dma_buffer(request, musb); in musb_gadget_queue()
1250 status = musb_queue_resume_work(musb, in musb_gadget_queue()
1254 dev_err(musb->controller, "%s resume work: %i\n", in musb_gadget_queue()
1261 spin_unlock_irqrestore(&musb->lock, lockflags); in musb_gadget_queue()
1262 pm_runtime_mark_last_busy(musb->controller); in musb_gadget_queue()
1263 pm_runtime_put_autosuspend(musb->controller); in musb_gadget_queue()
1275 struct musb *musb = musb_ep->musb; in musb_gadget_dequeue() local
1282 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_dequeue()
1289 dev_err(musb->controller, "request %p not queued to %s\n", in musb_gadget_dequeue()
1301 struct dma_controller *c = musb->dma_controller; in musb_gadget_dequeue()
1303 musb_ep_select(musb->mregs, musb_ep->current_epnum); in musb_gadget_dequeue()
1318 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_dequeue()
1332 struct musb *musb = musb_ep->musb; in musb_gadget_set_halt() local
1333 void __iomem *epio = musb->endpoints[epnum].regs; in musb_gadget_set_halt()
1342 mbase = musb->mregs; in musb_gadget_set_halt()
1344 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_set_halt()
1356 musb_dbg(musb, "request in progress, cannot halt %s", in musb_gadget_set_halt()
1365 musb_dbg(musb, "FIFO busy, cannot halt %s", in musb_gadget_set_halt()
1375 musb_dbg(musb, "%s: %s stall", ep->name, value ? "set" : "clear"); in musb_gadget_set_halt()
1402 musb_dbg(musb, "restarting the request"); in musb_gadget_set_halt()
1403 musb_ep_restart(musb, request); in musb_gadget_set_halt()
1407 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_set_halt()
1433 struct musb *musb = musb_ep->musb; in musb_gadget_fifo_status() local
1435 void __iomem *mbase = musb->mregs; in musb_gadget_fifo_status()
1438 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_fifo_status()
1444 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_fifo_status()
1452 struct musb *musb = musb_ep->musb; in musb_gadget_fifo_flush() local
1454 void __iomem *epio = musb->endpoints[epnum].regs; in musb_gadget_fifo_flush()
1459 mbase = musb->mregs; in musb_gadget_fifo_flush()
1461 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_fifo_flush()
1465 musb_writew(mbase, MUSB_INTRTXE, musb->intrtxe & ~(1 << epnum)); in musb_gadget_fifo_flush()
1489 musb_writew(mbase, MUSB_INTRTXE, musb->intrtxe); in musb_gadget_fifo_flush()
1490 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_fifo_flush()
1510 struct musb *musb = gadget_to_musb(gadget); in musb_gadget_get_frame() local
1512 return (int)musb_readw(musb->mregs, MUSB_FRAME); in musb_gadget_get_frame()
1517 struct musb *musb = gadget_to_musb(gadget); in musb_gadget_wakeup() local
1518 void __iomem *mregs = musb->mregs; in musb_gadget_wakeup()
1524 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_wakeup()
1526 switch (musb->xceiv->otg->state) { in musb_gadget_wakeup()
1532 if (musb->may_wakeup && musb->is_suspended) in musb_gadget_wakeup()
1538 musb_dbg(musb, "Sending SRP: devctl: %02x", devctl); in musb_gadget_wakeup()
1555 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_wakeup()
1556 otg_start_srp(musb->xceiv->otg); in musb_gadget_wakeup()
1557 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_wakeup()
1560 musb_platform_try_idle(musb, in musb_gadget_wakeup()
1566 musb_dbg(musb, "Unhandled wake: %s", in musb_gadget_wakeup()
1567 usb_otg_state_string(musb->xceiv->otg->state)); in musb_gadget_wakeup()
1576 musb_dbg(musb, "issue wakeup"); in musb_gadget_wakeup()
1585 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_wakeup()
1596 static void musb_pullup(struct musb *musb, int is_on) in musb_pullup() argument
1600 power = musb_readb(musb->mregs, MUSB_POWER); in musb_pullup()
1608 musb_dbg(musb, "gadget D+ pullup %s", in musb_pullup()
1610 musb_writeb(musb->mregs, MUSB_POWER, power); in musb_pullup()
1616 musb_dbg(musb, "<= %s =>\n", __func__);
1629 struct musb *musb = gadget_to_musb(gadget); in musb_gadget_vbus_draw() local
1631 return usb_phy_set_power(musb->xceiv, mA); in musb_gadget_vbus_draw()
1636 struct musb *musb; in musb_gadget_work() local
1639 musb = container_of(work, struct musb, gadget_work.work); in musb_gadget_work()
1640 pm_runtime_get_sync(musb->controller); in musb_gadget_work()
1641 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_work()
1642 musb_pullup(musb, musb->softconnect); in musb_gadget_work()
1643 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_work()
1644 pm_runtime_mark_last_busy(musb->controller); in musb_gadget_work()
1645 pm_runtime_put_autosuspend(musb->controller); in musb_gadget_work()
1650 struct musb *musb = gadget_to_musb(gadget); in musb_gadget_pullup() local
1658 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_pullup()
1659 if (is_on != musb->softconnect) { in musb_gadget_pullup()
1660 musb->softconnect = is_on; in musb_gadget_pullup()
1661 schedule_delayed_work(&musb->gadget_work, 0); in musb_gadget_pullup()
1663 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_pullup()
1693 init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) in init_peripheral_ep() argument
1695 struct musb_hw_ep *hw_ep = musb->endpoints + epnum; in init_peripheral_ep()
1700 ep->musb = musb; in init_peripheral_ep()
1715 musb->g.ep0 = &ep->end_point; in init_peripheral_ep()
1725 list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); in init_peripheral_ep()
1741 static inline void musb_g_init_endpoints(struct musb *musb) in musb_g_init_endpoints() argument
1748 INIT_LIST_HEAD(&(musb->g.ep_list)); in musb_g_init_endpoints()
1750 for (epnum = 0, hw_ep = musb->endpoints; in musb_g_init_endpoints()
1751 epnum < musb->nr_endpoints; in musb_g_init_endpoints()
1754 init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 0); in musb_g_init_endpoints()
1758 init_peripheral_ep(musb, &hw_ep->ep_in, in musb_g_init_endpoints()
1763 init_peripheral_ep(musb, &hw_ep->ep_out, in musb_g_init_endpoints()
1774 int musb_gadget_setup(struct musb *musb) in musb_gadget_setup() argument
1783 musb->g.ops = &musb_gadget_operations; in musb_gadget_setup()
1784 musb->g.max_speed = USB_SPEED_HIGH; in musb_gadget_setup()
1785 musb->g.speed = USB_SPEED_UNKNOWN; in musb_gadget_setup()
1787 MUSB_DEV_MODE(musb); in musb_gadget_setup()
1788 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in musb_gadget_setup()
1791 musb->g.name = musb_driver_name; in musb_gadget_setup()
1793 musb->g.is_otg = 0; in musb_gadget_setup()
1794 INIT_DELAYED_WORK(&musb->gadget_work, musb_gadget_work); in musb_gadget_setup()
1795 musb_g_init_endpoints(musb); in musb_gadget_setup()
1797 musb->is_active = 0; in musb_gadget_setup()
1798 musb_platform_try_idle(musb, 0); in musb_gadget_setup()
1800 status = usb_add_gadget_udc(musb->controller, &musb->g); in musb_gadget_setup()
1806 musb->g.dev.parent = NULL; in musb_gadget_setup()
1807 device_unregister(&musb->g.dev); in musb_gadget_setup()
1811 void musb_gadget_cleanup(struct musb *musb) in musb_gadget_cleanup() argument
1813 if (musb->port_mode == MUSB_HOST) in musb_gadget_cleanup()
1816 cancel_delayed_work_sync(&musb->gadget_work); in musb_gadget_cleanup()
1817 usb_del_gadget_udc(&musb->g); in musb_gadget_cleanup()
1834 struct musb *musb = gadget_to_musb(g); in musb_gadget_start() local
1835 struct usb_otg *otg = musb->xceiv->otg; in musb_gadget_start()
1844 pm_runtime_get_sync(musb->controller); in musb_gadget_start()
1846 musb->softconnect = 0; in musb_gadget_start()
1847 musb->gadget_driver = driver; in musb_gadget_start()
1849 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_start()
1850 musb->is_active = 1; in musb_gadget_start()
1852 otg_set_peripheral(otg, &musb->g); in musb_gadget_start()
1853 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in musb_gadget_start()
1854 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_start()
1856 musb_start(musb); in musb_gadget_start()
1862 if (musb->xceiv->last_event == USB_EVENT_ID) in musb_gadget_start()
1863 musb_platform_set_vbus(musb, 1); in musb_gadget_start()
1865 pm_runtime_mark_last_busy(musb->controller); in musb_gadget_start()
1866 pm_runtime_put_autosuspend(musb->controller); in musb_gadget_start()
1882 struct musb *musb = gadget_to_musb(g); in musb_gadget_stop() local
1885 pm_runtime_get_sync(musb->controller); in musb_gadget_stop()
1892 spin_lock_irqsave(&musb->lock, flags); in musb_gadget_stop()
1894 musb_hnp_stop(musb); in musb_gadget_stop()
1896 (void) musb_gadget_vbus_draw(&musb->g, 0); in musb_gadget_stop()
1898 musb->xceiv->otg->state = OTG_STATE_UNDEFINED; in musb_gadget_stop()
1899 musb_stop(musb); in musb_gadget_stop()
1900 otg_set_peripheral(musb->xceiv->otg, NULL); in musb_gadget_stop()
1902 musb->is_active = 0; in musb_gadget_stop()
1903 musb->gadget_driver = NULL; in musb_gadget_stop()
1904 musb_platform_try_idle(musb, 0); in musb_gadget_stop()
1905 spin_unlock_irqrestore(&musb->lock, flags); in musb_gadget_stop()
1914 pm_runtime_mark_last_busy(musb->controller); in musb_gadget_stop()
1915 pm_runtime_put_autosuspend(musb->controller); in musb_gadget_stop()
1924 void musb_g_resume(struct musb *musb) in musb_g_resume() argument
1926 musb->is_suspended = 0; in musb_g_resume()
1927 switch (musb->xceiv->otg->state) { in musb_g_resume()
1932 musb->is_active = 1; in musb_g_resume()
1933 if (musb->gadget_driver && musb->gadget_driver->resume) { in musb_g_resume()
1934 spin_unlock(&musb->lock); in musb_g_resume()
1935 musb->gadget_driver->resume(&musb->g); in musb_g_resume()
1936 spin_lock(&musb->lock); in musb_g_resume()
1941 usb_otg_state_string(musb->xceiv->otg->state)); in musb_g_resume()
1946 void musb_g_suspend(struct musb *musb) in musb_g_suspend() argument
1950 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); in musb_g_suspend()
1951 musb_dbg(musb, "musb_g_suspend: devctl %02x", devctl); in musb_g_suspend()
1953 switch (musb->xceiv->otg->state) { in musb_g_suspend()
1956 musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; in musb_g_suspend()
1959 musb->is_suspended = 1; in musb_g_suspend()
1960 if (musb->gadget_driver && musb->gadget_driver->suspend) { in musb_g_suspend()
1961 spin_unlock(&musb->lock); in musb_g_suspend()
1962 musb->gadget_driver->suspend(&musb->g); in musb_g_suspend()
1963 spin_lock(&musb->lock); in musb_g_suspend()
1971 usb_otg_state_string(musb->xceiv->otg->state)); in musb_g_suspend()
1976 void musb_g_wakeup(struct musb *musb) in musb_g_wakeup() argument
1978 musb_gadget_wakeup(&musb->g); in musb_g_wakeup()
1982 void musb_g_disconnect(struct musb *musb) in musb_g_disconnect() argument
1984 void __iomem *mregs = musb->mregs; in musb_g_disconnect()
1987 musb_dbg(musb, "musb_g_disconnect: devctl %02x", devctl); in musb_g_disconnect()
1993 (void) musb_gadget_vbus_draw(&musb->g, 0); in musb_g_disconnect()
1995 musb->g.speed = USB_SPEED_UNKNOWN; in musb_g_disconnect()
1996 if (musb->gadget_driver && musb->gadget_driver->disconnect) { in musb_g_disconnect()
1997 spin_unlock(&musb->lock); in musb_g_disconnect()
1998 musb->gadget_driver->disconnect(&musb->g); in musb_g_disconnect()
1999 spin_lock(&musb->lock); in musb_g_disconnect()
2002 switch (musb->xceiv->otg->state) { in musb_g_disconnect()
2004 musb_dbg(musb, "Unhandled disconnect %s, setting a_idle", in musb_g_disconnect()
2005 usb_otg_state_string(musb->xceiv->otg->state)); in musb_g_disconnect()
2006 musb->xceiv->otg->state = OTG_STATE_A_IDLE; in musb_g_disconnect()
2007 MUSB_HST_MODE(musb); in musb_g_disconnect()
2010 musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; in musb_g_disconnect()
2011 MUSB_HST_MODE(musb); in musb_g_disconnect()
2017 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in musb_g_disconnect()
2023 musb->is_active = 0; in musb_g_disconnect()
2026 void musb_g_reset(struct musb *musb) in musb_g_reset() argument
2027 __releases(musb->lock) in musb_g_reset()
2028 __acquires(musb->lock) in musb_g_reset()
2030 void __iomem *mbase = musb->mregs; in musb_g_reset()
2034 musb_dbg(musb, "<== %s driver '%s'", in musb_g_reset()
2037 musb->gadget_driver in musb_g_reset()
2038 ? musb->gadget_driver->driver.name in musb_g_reset()
2043 if (musb->gadget_driver && musb->g.speed != USB_SPEED_UNKNOWN) { in musb_g_reset()
2044 spin_unlock(&musb->lock); in musb_g_reset()
2045 usb_gadget_udc_reset(&musb->g, musb->gadget_driver); in musb_g_reset()
2046 spin_lock(&musb->lock); in musb_g_reset()
2056 musb->g.speed = (power & MUSB_POWER_HSMODE) in musb_g_reset()
2060 musb->is_active = 1; in musb_g_reset()
2061 musb->is_suspended = 0; in musb_g_reset()
2062 MUSB_DEV_MODE(musb); in musb_g_reset()
2063 musb->address = 0; in musb_g_reset()
2064 musb->ep0_state = MUSB_EP0_STAGE_SETUP; in musb_g_reset()
2066 musb->may_wakeup = 0; in musb_g_reset()
2067 musb->g.b_hnp_enable = 0; in musb_g_reset()
2068 musb->g.a_alt_hnp_support = 0; in musb_g_reset()
2069 musb->g.a_hnp_support = 0; in musb_g_reset()
2070 musb->g.quirk_zlp_not_supp = 1; in musb_g_reset()
2075 if (!musb->g.is_otg) { in musb_g_reset()
2081 musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; in musb_g_reset()
2082 musb->g.is_a_peripheral = 0; in musb_g_reset()
2084 musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; in musb_g_reset()
2085 musb->g.is_a_peripheral = 0; in musb_g_reset()
2087 musb->xceiv->otg->state = OTG_STATE_A_PERIPHERAL; in musb_g_reset()
2088 musb->g.is_a_peripheral = 1; in musb_g_reset()
2092 (void) musb_gadget_vbus_draw(&musb->g, 8); in musb_g_reset()