Lines Matching refs:ep
110 struct musb_ep *musb_ep = request->ep; in unmap_dma_buffer()
147 struct musb_ep *ep, in musb_g_giveback() argument
150 __releases(ep->musb->lock) in musb_g_giveback()
151 __acquires(ep->musb->lock) in musb_g_giveback()
155 int busy = ep->busy; in musb_g_giveback()
164 ep->busy = 1; in musb_g_giveback()
172 ep->end_point.name, request, in musb_g_giveback()
176 ep->end_point.name, request, in musb_g_giveback()
179 usb_gadget_giveback_request(&req->ep->end_point, &req->request); in musb_g_giveback()
181 ep->busy = busy; in musb_g_giveback()
190 static void nuke(struct musb_ep *ep, const int status) in nuke() argument
192 struct musb *musb = ep->musb; in nuke()
194 void __iomem *epio = ep->musb->endpoints[ep->current_epnum].regs; in nuke()
196 ep->busy = 1; in nuke()
198 if (is_dma_capable() && ep->dma) { in nuke()
199 struct dma_controller *c = ep->musb->dma_controller; in nuke()
202 if (ep->is_in) { in nuke()
219 value = c->channel_abort(ep->dma); in nuke()
221 ep->name, value); in nuke()
222 c->channel_release(ep->dma); in nuke()
223 ep->dma = NULL; in nuke()
226 while (!list_empty(&ep->req_list)) { in nuke()
227 req = list_first_entry(&ep->req_list, struct musb_request, list); in nuke()
228 musb_g_giveback(ep, &req->request, status); in nuke()
241 static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) in max_ep_writesize() argument
243 if (can_bulk_split(musb, ep->type)) in max_ep_writesize()
244 return ep->hw_ep->max_packet_sz_tx; in max_ep_writesize()
246 return ep->packet_sz; in max_ep_writesize()
265 musb_ep = req->ep; in txstate()
953 static int musb_gadget_enable(struct usb_ep *ep, in musb_gadget_enable() argument
967 if (!ep || !desc) in musb_gadget_enable()
970 musb_ep = to_musb_ep(ep); in musb_gadget_enable()
1140 static int musb_gadget_disable(struct usb_ep *ep) in musb_gadget_disable() argument
1149 musb_ep = to_musb_ep(ep); in musb_gadget_disable()
1187 struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) in musb_alloc_request() argument
1189 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_alloc_request()
1201 request->ep = musb_ep; in musb_alloc_request()
1210 void musb_free_request(struct usb_ep *ep, struct usb_request *req) in musb_free_request() argument
1240 static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, in musb_gadget_queue() argument
1249 if (!ep || !req) in musb_gadget_queue()
1254 musb_ep = to_musb_ep(ep); in musb_gadget_queue()
1260 if (request->ep != musb_ep) in musb_gadget_queue()
1263 dev_dbg(musb->controller, "<== to %s request=%p\n", ep->name, req); in musb_gadget_queue()
1278 req, ep->name, "disabled"); in musb_gadget_queue()
1296 static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request) in musb_gadget_dequeue() argument
1298 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_dequeue()
1305 if (!ep || !request || to_musb_request(request)->ep != musb_ep) in musb_gadget_dequeue()
1315 dev_dbg(musb->controller, "request %p not queued to %s\n", request, ep->name); in musb_gadget_dequeue()
1353 static int musb_gadget_set_halt(struct usb_ep *ep, int value) in musb_gadget_set_halt() argument
1355 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_set_halt()
1365 if (!ep) in musb_gadget_set_halt()
1382 ep->name); in musb_gadget_set_halt()
1390 dev_dbg(musb->controller, "FIFO busy, cannot halt %s\n", ep->name); in musb_gadget_set_halt()
1399 dev_dbg(musb->controller, "%s: %s stall\n", ep->name, value ? "set" : "clear"); in musb_gadget_set_halt()
1438 static int musb_gadget_set_wedge(struct usb_ep *ep) in musb_gadget_set_wedge() argument
1440 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_set_wedge()
1442 if (!ep) in musb_gadget_set_wedge()
1447 return usb_ep_set_halt(ep); in musb_gadget_set_wedge()
1450 static int musb_gadget_fifo_status(struct usb_ep *ep) in musb_gadget_fifo_status() argument
1452 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_fifo_status()
1473 static void musb_gadget_fifo_flush(struct usb_ep *ep) in musb_gadget_fifo_flush() argument
1475 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_fifo_flush()
1689 struct usb_ep *ep = NULL; in musb_match_ep() local
1695 ep = gadget_find_ep_by_name(g, "ep5in"); in musb_match_ep()
1697 ep = gadget_find_ep_by_name(g, "ep6out"); in musb_match_ep()
1701 ep = gadget_find_ep_by_name(g, "ep1in"); in musb_match_ep()
1703 ep = gadget_find_ep_by_name(g, "ep2out"); in musb_match_ep()
1709 if (ep && usb_gadget_ep_match_desc(g, ep, desc, ep_comp)) in musb_match_ep()
1710 return ep; in musb_match_ep()
1744 init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) in init_peripheral_ep() argument
1748 memset(ep, 0, sizeof *ep); in init_peripheral_ep()
1750 ep->current_epnum = epnum; in init_peripheral_ep()
1751 ep->musb = musb; in init_peripheral_ep()
1752 ep->hw_ep = hw_ep; in init_peripheral_ep()
1753 ep->is_in = is_in; in init_peripheral_ep()
1755 INIT_LIST_HEAD(&ep->req_list); in init_peripheral_ep()
1757 sprintf(ep->name, "ep%d%s", epnum, in init_peripheral_ep()
1760 ep->end_point.name = ep->name; in init_peripheral_ep()
1761 INIT_LIST_HEAD(&ep->end_point.ep_list); in init_peripheral_ep()
1763 usb_ep_set_maxpacket_limit(&ep->end_point, 64); in init_peripheral_ep()
1764 ep->end_point.caps.type_control = true; in init_peripheral_ep()
1765 ep->end_point.ops = &musb_g_ep0_ops; in init_peripheral_ep()
1766 musb->g.ep0 = &ep->end_point; in init_peripheral_ep()
1769 usb_ep_set_maxpacket_limit(&ep->end_point, hw_ep->max_packet_sz_tx); in init_peripheral_ep()
1771 usb_ep_set_maxpacket_limit(&ep->end_point, hw_ep->max_packet_sz_rx); in init_peripheral_ep()
1772 ep->end_point.caps.type_iso = true; in init_peripheral_ep()
1773 ep->end_point.caps.type_bulk = true; in init_peripheral_ep()
1774 ep->end_point.caps.type_int = true; in init_peripheral_ep()
1775 ep->end_point.ops = &musb_ep_ops; in init_peripheral_ep()
1776 list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); in init_peripheral_ep()
1780 ep->end_point.caps.dir_in = true; in init_peripheral_ep()
1781 ep->end_point.caps.dir_out = true; in init_peripheral_ep()
1783 ep->end_point.caps.dir_in = true; in init_peripheral_ep()
1785 ep->end_point.caps.dir_out = true; in init_peripheral_ep()