Lines Matching refs:musb_ep

33 			struct musb *musb, struct musb_ep *musb_ep)  in map_dma_buffer()  argument
40 if (!is_dma_capable() || !musb_ep->dma) in map_dma_buffer()
48 compatible = dma->is_compatible(musb_ep->dma, in map_dma_buffer()
49 musb_ep->packet_sz, request->request.buf, in map_dma_buffer()
86 struct musb_ep *musb_ep = request->ep; in unmap_dma_buffer() local
88 if (!is_buffer_mapped(request) || !musb_ep->dma) in unmap_dma_buffer()
123 struct musb_ep *ep, in musb_g_giveback()
158 static void nuke(struct musb_ep *ep, const int status) in nuke()
208 static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) in max_ep_writesize()
226 struct musb_ep *musb_ep; in txstate() local
232 musb_ep = req->ep; in txstate()
235 if (!musb_ep->desc) { in txstate()
237 musb_ep->end_point.name); in txstate()
242 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { in txstate()
251 fifo_count = min(max_ep_writesize(musb, musb_ep), in txstate()
256 musb_ep->end_point.name, csr); in txstate()
262 musb_ep->end_point.name, csr); in txstate()
267 epnum, musb_ep->packet_sz, fifo_count, in txstate()
277 musb_ep->dma->max_len); in txstate()
284 if (request_size < musb_ep->packet_sz) in txstate()
285 musb_ep->dma->desired_mode = 0; in txstate()
287 musb_ep->dma->desired_mode = 1; in txstate()
290 musb_ep->dma, musb_ep->packet_sz, in txstate()
291 musb_ep->dma->desired_mode, in txstate()
294 if (musb_ep->dma->desired_mode == 0) { in txstate()
322 if (!musb_ep->hb_mult || in txstate()
324 musb_ep->type)) in txstate()
358 musb_ep->dma, musb_ep->packet_sz, in txstate()
363 c->channel_release(musb_ep->dma); in txstate()
364 musb_ep->dma = NULL; in txstate()
371 musb_ep->dma, musb_ep->packet_sz, in txstate()
385 musb_write_fifo(musb_ep->hw_ep, fifo_count, in txstate()
395 musb_ep->end_point.name, use_dma ? "dma" : "pio", in txstate()
412 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; in musb_g_tx() local
417 req = next_request(musb_ep); in musb_g_tx()
421 musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); in musb_g_tx()
423 dma = is_dma_capable() ? musb_ep->dma : NULL; in musb_g_tx()
450 musb_dbg(musb, "%s dma still busy?", musb_ep->end_point.name); in musb_g_tx()
465 request->actual += musb_ep->dma->actual_len; in musb_g_tx()
467 epnum, csr, musb_ep->dma->actual_len, request); in musb_g_tx()
475 && (request->length % musb_ep->packet_sz == 0) in musb_g_tx()
491 musb_g_giveback(musb_ep, request, 0); in musb_g_tx()
501 req = musb_ep->desc ? next_request(musb_ep) : NULL; in musb_g_tx()
504 musb_ep->end_point.name); in musb_g_tx()
522 struct musb_ep *musb_ep; in rxstate() local
531 musb_ep = &hw_ep->ep_in; in rxstate()
533 musb_ep = &hw_ep->ep_out; in rxstate()
535 fifo_count = musb_ep->packet_sz; in rxstate()
538 if (!musb_ep->desc) { in rxstate()
540 musb_ep->end_point.name); in rxstate()
545 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { in rxstate()
552 musb_ep->end_point.name, csr); in rxstate()
558 struct dma_channel *channel = musb_ep->dma; in rxstate()
566 musb_ep->packet_sz, in rxstate()
592 if (request->short_not_ok && fifo_count == musb_ep->packet_sz) in rxstate()
608 channel = musb_ep->dma; in rxstate()
651 musb_ep->dma->desired_mode = 1; in rxstate()
653 if (!musb_ep->hb_mult && in rxstate()
654 musb_ep->hw_ep->rx_double_buffered) in rxstate()
661 musb_ep->dma->desired_mode = 0; in rxstate()
666 musb_ep->packet_sz, in rxstate()
684 channel = musb_ep->dma; in rxstate()
687 if (fifo_count < musb_ep->packet_sz) in rxstate()
706 if (transfer_size <= musb_ep->packet_sz) { in rxstate()
707 musb_ep->dma->desired_mode = 0; in rxstate()
709 musb_ep->dma->desired_mode = 1; in rxstate()
716 musb_ep->packet_sz, in rxstate()
727 musb_ep->end_point.name, in rxstate()
729 musb_ep->packet_sz); in rxstate()
735 struct dma_channel *channel = musb_ep->dma; in rxstate()
740 musb_ep->packet_sz, in rxstate()
766 musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) in rxstate()
783 fifo_count < musb_ep->packet_sz) in rxstate()
784 musb_g_giveback(musb_ep, request, 0); in rxstate()
796 struct musb_ep *musb_ep; in musb_g_rx() local
802 musb_ep = &hw_ep->ep_in; in musb_g_rx()
804 musb_ep = &hw_ep->ep_out; in musb_g_rx()
808 req = next_request(musb_ep); in musb_g_rx()
816 dma = is_dma_capable() ? musb_ep->dma : NULL; 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()
845 musb_ep->end_point.name, csr); in musb_g_rx()
856 request->actual += musb_ep->dma->actual_len; in musb_g_rx()
863 & (musb_ep->packet_sz - 1))) { in musb_g_rx()
871 && (musb_ep->dma->actual_len in musb_g_rx()
872 == musb_ep->packet_sz)) { in musb_g_rx()
883 musb_g_giveback(musb_ep, request, 0); in musb_g_rx()
894 req = next_request(musb_ep); in musb_g_rx()
912 struct musb_ep *musb_ep; in musb_gadget_enable() local
925 musb_ep = to_musb_ep(ep); in musb_gadget_enable()
926 hw_ep = musb_ep->hw_ep; in musb_gadget_enable()
928 musb = musb_ep->musb; in musb_gadget_enable()
930 epnum = musb_ep->current_epnum; in musb_gadget_enable()
934 if (musb_ep->desc) { in musb_gadget_enable()
938 musb_ep->type = usb_endpoint_type(desc); in musb_gadget_enable()
958 musb_ep->hb_mult = tmp; in musb_gadget_enable()
960 musb_ep->hb_mult = 0; in musb_gadget_enable()
963 musb_ep->packet_sz = usb_endpoint_maxp(desc); in musb_gadget_enable()
964 tmp = musb_ep->packet_sz * (musb_ep->hb_mult + 1); in musb_gadget_enable()
973 musb_ep->is_in = 1; in musb_gadget_enable()
974 if (!musb_ep->is_in) in musb_gadget_enable()
991 if (can_bulk_split(musb, musb_ep->type)) in musb_gadget_enable()
992 musb_ep->hb_mult = (hw_ep->max_packet_sz_tx / in musb_gadget_enable()
993 musb_ep->packet_sz) - 1; in musb_gadget_enable()
994 musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz in musb_gadget_enable()
995 | (musb_ep->hb_mult << 11)); in musb_gadget_enable()
1001 if (musb_ep->type == USB_ENDPOINT_XFER_ISOC) in musb_gadget_enable()
1012 musb_ep->is_in = 0; in musb_gadget_enable()
1013 if (musb_ep->is_in) in musb_gadget_enable()
1030 musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz in musb_gadget_enable()
1031 | (musb_ep->hb_mult << 11)); in musb_gadget_enable()
1041 if (musb_ep->type == USB_ENDPOINT_XFER_ISOC) in musb_gadget_enable()
1043 else if (musb_ep->type == USB_ENDPOINT_XFER_INT) in musb_gadget_enable()
1057 musb_ep->dma = c->channel_alloc(c, hw_ep, in musb_gadget_enable()
1060 musb_ep->dma = NULL; in musb_gadget_enable()
1062 musb_ep->desc = desc; in musb_gadget_enable()
1063 musb_ep->busy = 0; in musb_gadget_enable()
1064 musb_ep->wedged = 0; in musb_gadget_enable()
1068 musb_driver_name, musb_ep->end_point.name, in musb_gadget_enable()
1069 musb_ep_xfertype_string(musb_ep->type), in musb_gadget_enable()
1070 musb_ep->is_in ? "IN" : "OUT", in musb_gadget_enable()
1071 musb_ep->dma ? "dma, " : "", in musb_gadget_enable()
1072 musb_ep->packet_sz); in musb_gadget_enable()
1089 struct musb_ep *musb_ep; in musb_gadget_disable() local
1092 musb_ep = to_musb_ep(ep); in musb_gadget_disable()
1093 musb = musb_ep->musb; in musb_gadget_disable()
1094 epnum = musb_ep->current_epnum; in musb_gadget_disable()
1101 if (musb_ep->is_in) { in musb_gadget_disable()
1112 nuke(musb_ep, -ESHUTDOWN); in musb_gadget_disable()
1114 musb_ep->desc = NULL; in musb_gadget_disable()
1115 musb_ep->end_point.desc = NULL; in musb_gadget_disable()
1121 musb_dbg(musb, "%s", musb_ep->end_point.name); in musb_gadget_disable()
1132 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_alloc_request() local
1140 request->epnum = musb_ep->current_epnum; in musb_alloc_request()
1141 request->ep = musb_ep; in musb_alloc_request()
1184 struct musb_ep *musb_ep; in musb_gadget_queue() local
1195 musb_ep = to_musb_ep(ep); in musb_gadget_queue()
1196 musb = musb_ep->musb; in musb_gadget_queue()
1201 if (request->ep != musb_ep) in musb_gadget_queue()
1220 request->epnum = musb_ep->current_epnum; in musb_gadget_queue()
1221 request->tx = musb_ep->is_in; in musb_gadget_queue()
1223 map_dma_buffer(request, musb, musb_ep); in musb_gadget_queue()
1228 if (!musb_ep->desc) { in musb_gadget_queue()
1237 list_add_tail(&request->list, &musb_ep->req_list); in musb_gadget_queue()
1240 if (!musb_ep->busy && &request->list == musb_ep->req_list.next) { in musb_gadget_queue()
1261 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_dequeue() local
1266 struct musb *musb = musb_ep->musb; in musb_gadget_dequeue()
1268 if (!ep || !request || req->ep != musb_ep) in musb_gadget_dequeue()
1275 list_for_each_entry(r, &musb_ep->req_list, list) { in musb_gadget_dequeue()
1287 if (musb_ep->req_list.next != &req->list || musb_ep->busy) in musb_gadget_dequeue()
1288 musb_g_giveback(musb_ep, request, -ECONNRESET); in musb_gadget_dequeue()
1291 else if (is_dma_capable() && musb_ep->dma) { in musb_gadget_dequeue()
1294 musb_ep_select(musb->mregs, musb_ep->current_epnum); in musb_gadget_dequeue()
1296 status = c->channel_abort(musb_ep->dma); in musb_gadget_dequeue()
1300 musb_g_giveback(musb_ep, request, -ECONNRESET); in musb_gadget_dequeue()
1305 musb_g_giveback(musb_ep, request, -ECONNRESET); in musb_gadget_dequeue()
1321 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_set_halt() local
1322 u8 epnum = musb_ep->current_epnum; in musb_gadget_set_halt()
1323 struct musb *musb = musb_ep->musb; in musb_gadget_set_halt()
1337 if ((USB_ENDPOINT_XFER_ISOC == musb_ep->type)) { in musb_gadget_set_halt()
1344 request = next_request(musb_ep); in musb_gadget_set_halt()
1353 if (musb_ep->is_in) { in musb_gadget_set_halt()
1363 musb_ep->wedged = 0; in musb_gadget_set_halt()
1367 if (musb_ep->is_in) { in musb_gadget_set_halt()
1392 if (!musb_ep->busy && !value && request) { in musb_gadget_set_halt()
1407 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_set_wedge() local
1412 musb_ep->wedged = 1; in musb_gadget_set_wedge()
1419 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_fifo_status() local
1420 void __iomem *epio = musb_ep->hw_ep->regs; in musb_gadget_fifo_status()
1423 if (musb_ep->desc && !musb_ep->is_in) { in musb_gadget_fifo_status()
1424 struct musb *musb = musb_ep->musb; in musb_gadget_fifo_status()
1425 int epnum = musb_ep->current_epnum; in musb_gadget_fifo_status()
1442 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_fifo_flush() local
1443 struct musb *musb = musb_ep->musb; in musb_gadget_fifo_flush()
1444 u8 epnum = musb_ep->current_epnum; in musb_gadget_fifo_flush()
1458 if (musb_ep->is_in) { in musb_gadget_fifo_flush()
1686 init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) in init_peripheral_ep()