Lines Matching refs:musb_ep

81 			struct musb *musb, struct musb_ep *musb_ep)  in map_dma_buffer()  argument
88 if (!is_dma_capable() || !musb_ep->dma) in map_dma_buffer()
96 compatible = dma->is_compatible(musb_ep->dma, in map_dma_buffer()
97 musb_ep->packet_sz, request->request.buf, in map_dma_buffer()
154 struct musb *musb, struct musb_ep *musb_ep) in map_dma_buffer() argument
172 struct musb_ep *ep, in musb_g_giveback()
212 static void nuke(struct musb_ep *ep, const int status) in nuke()
263 static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) in max_ep_writesize()
316 struct musb_ep *musb_ep; in txstate() local
322 musb_ep = req->ep; in txstate()
325 if (!musb_ep->desc) { in txstate()
327 musb_ep->end_point.name); in txstate()
332 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { in txstate()
341 fifo_count = min(max_ep_writesize(musb, musb_ep), in txstate()
346 musb_ep->end_point.name, csr); in txstate()
352 musb_ep->end_point.name, csr); in txstate()
357 epnum, musb_ep->packet_sz, fifo_count, in txstate()
367 musb_ep->dma->max_len); in txstate()
375 if (request_size < musb_ep->packet_sz) in txstate()
376 musb_ep->dma->desired_mode = 0; in txstate()
378 musb_ep->dma->desired_mode = 1; in txstate()
381 musb_ep->dma, musb_ep->packet_sz, in txstate()
382 musb_ep->dma->desired_mode, in txstate()
385 if (musb_ep->dma->desired_mode == 0) { in txstate()
404 if (!musb_ep->hb_mult) in txstate()
436 musb_ep->dma, musb_ep->packet_sz, in txstate()
441 c->channel_release(musb_ep->dma); in txstate()
442 musb_ep->dma = NULL; in txstate()
449 musb_ep->dma, musb_ep->packet_sz, in txstate()
464 musb_write_fifo(musb_ep->hw_ep, fifo_count, in txstate()
474 musb_ep->end_point.name, use_dma ? "dma" : "pio", in txstate()
491 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; in musb_g_tx() local
496 req = next_request(musb_ep); in musb_g_tx()
500 dev_dbg(musb->controller, "<== %s, txcsr %04x\n", musb_ep->end_point.name, csr); in musb_g_tx()
502 dma = is_dma_capable() ? musb_ep->dma : NULL; in musb_g_tx()
529 dev_dbg(musb->controller, "%s dma still busy?\n", musb_ep->end_point.name); in musb_g_tx()
544 request->actual += musb_ep->dma->actual_len; in musb_g_tx()
546 epnum, csr, musb_ep->dma->actual_len, request); in musb_g_tx()
554 && (request->length % musb_ep->packet_sz == 0) in musb_g_tx()
559 (musb_ep->packet_sz - 1)))) in musb_g_tx()
576 musb_g_giveback(musb_ep, request, 0); in musb_g_tx()
586 req = musb_ep->desc ? next_request(musb_ep) : NULL; in musb_g_tx()
589 musb_ep->end_point.name); in musb_g_tx()
638 struct musb_ep *musb_ep; in rxstate() local
647 musb_ep = &hw_ep->ep_in; in rxstate()
649 musb_ep = &hw_ep->ep_out; in rxstate()
651 len = musb_ep->packet_sz; in rxstate()
654 if (!musb_ep->desc) { in rxstate()
656 musb_ep->end_point.name); in rxstate()
661 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { in rxstate()
668 musb_ep->end_point.name, csr); in rxstate()
674 struct dma_channel *channel = musb_ep->dma; in rxstate()
682 musb_ep->packet_sz, in rxstate()
708 if (request->short_not_ok && len == musb_ep->packet_sz) in rxstate()
721 channel = musb_ep->dma; in rxstate()
761 if (!musb_ep->hb_mult && in rxstate()
762 musb_ep->hw_ep->rx_double_buffered) in rxstate()
773 musb_ep->dma->desired_mode = 1; in rxstate()
777 musb_ep->dma->desired_mode = 0; in rxstate()
782 musb_ep->packet_sz, in rxstate()
801 channel = musb_ep->dma; in rxstate()
804 if (len < musb_ep->packet_sz) in rxstate()
821 if (transfer_size <= musb_ep->packet_sz) { in rxstate()
822 musb_ep->dma->desired_mode = 0; in rxstate()
824 musb_ep->dma->desired_mode = 1; in rxstate()
831 musb_ep->packet_sz, in rxstate()
843 musb_ep->end_point.name, in rxstate()
845 musb_ep->packet_sz); in rxstate()
852 struct dma_channel *channel = musb_ep->dma; in rxstate()
857 musb_ep->packet_sz, in rxstate()
881 musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) in rxstate()
897 if (request->actual == request->length || len < musb_ep->packet_sz) in rxstate()
898 musb_g_giveback(musb_ep, request, 0); in rxstate()
910 struct musb_ep *musb_ep; in musb_g_rx() local
916 musb_ep = &hw_ep->ep_in; in musb_g_rx()
918 musb_ep = &hw_ep->ep_out; in musb_g_rx()
922 req = next_request(musb_ep); in musb_g_rx()
929 dma = is_dma_capable() ? musb_ep->dma : NULL; in musb_g_rx()
931 dev_dbg(musb->controller, "<== %s, rxcsr %04x%s %p\n", musb_ep->end_point.name, in musb_g_rx()
946 dev_dbg(musb->controller, "%s iso overrun on %p\n", musb_ep->name, request); in musb_g_rx()
952 dev_dbg(musb->controller, "%s, incomprx\n", musb_ep->end_point.name); in musb_g_rx()
958 musb_ep->end_point.name, csr); in musb_g_rx()
969 request->actual += musb_ep->dma->actual_len; in musb_g_rx()
974 musb_ep->dma->actual_len, request); in musb_g_rx()
981 & (musb_ep->packet_sz - 1))) { in musb_g_rx()
989 && (musb_ep->dma->actual_len in musb_g_rx()
990 == musb_ep->packet_sz)) { in musb_g_rx()
1001 musb_g_giveback(musb_ep, request, 0); in musb_g_rx()
1012 req = next_request(musb_ep); in musb_g_rx()
1030 struct musb_ep *musb_ep; in musb_gadget_enable() local
1043 musb_ep = to_musb_ep(ep); in musb_gadget_enable()
1044 hw_ep = musb_ep->hw_ep; in musb_gadget_enable()
1046 musb = musb_ep->musb; in musb_gadget_enable()
1048 epnum = musb_ep->current_epnum; in musb_gadget_enable()
1052 if (musb_ep->desc) { in musb_gadget_enable()
1056 musb_ep->type = usb_endpoint_type(desc); in musb_gadget_enable()
1076 musb_ep->hb_mult = (tmp >> 11) & 3; in musb_gadget_enable()
1078 musb_ep->hb_mult = 0; in musb_gadget_enable()
1081 musb_ep->packet_sz = tmp & 0x7ff; in musb_gadget_enable()
1082 tmp = musb_ep->packet_sz * (musb_ep->hb_mult + 1); in musb_gadget_enable()
1092 musb_ep->is_in = 1; in musb_gadget_enable()
1093 if (!musb_ep->is_in) in musb_gadget_enable()
1113 musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz in musb_gadget_enable()
1114 | (musb_ep->hb_mult << 11)); in musb_gadget_enable()
1120 if (musb_ep->type == USB_ENDPOINT_XFER_ISOC) in musb_gadget_enable()
1132 musb_ep->is_in = 0; in musb_gadget_enable()
1133 if (musb_ep->is_in) in musb_gadget_enable()
1153 musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz in musb_gadget_enable()
1154 | (musb_ep->hb_mult << 11)); in musb_gadget_enable()
1164 if (musb_ep->type == USB_ENDPOINT_XFER_ISOC) in musb_gadget_enable()
1166 else if (musb_ep->type == USB_ENDPOINT_XFER_INT) in musb_gadget_enable()
1180 musb_ep->dma = c->channel_alloc(c, hw_ep, in musb_gadget_enable()
1183 musb_ep->dma = NULL; in musb_gadget_enable()
1185 musb_ep->desc = desc; in musb_gadget_enable()
1186 musb_ep->busy = 0; in musb_gadget_enable()
1187 musb_ep->wedged = 0; in musb_gadget_enable()
1191 musb_driver_name, musb_ep->end_point.name, in musb_gadget_enable()
1192 ({ char *s; switch (musb_ep->type) { in musb_gadget_enable()
1197 musb_ep->is_in ? "IN" : "OUT", in musb_gadget_enable()
1198 musb_ep->dma ? "dma, " : "", in musb_gadget_enable()
1199 musb_ep->packet_sz); in musb_gadget_enable()
1216 struct musb_ep *musb_ep; in musb_gadget_disable() local
1220 musb_ep = to_musb_ep(ep); in musb_gadget_disable()
1221 musb = musb_ep->musb; in musb_gadget_disable()
1222 epnum = musb_ep->current_epnum; in musb_gadget_disable()
1229 if (musb_ep->is_in) { in musb_gadget_disable()
1241 musb_ep->desc = NULL; in musb_gadget_disable()
1243 musb_ep->end_point.desc = NULL; in musb_gadget_disable()
1247 nuke(musb_ep, -ESHUTDOWN); in musb_gadget_disable()
1253 dev_dbg(musb->controller, "%s\n", musb_ep->end_point.name); in musb_gadget_disable()
1264 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_alloc_request() local
1265 struct musb *musb = musb_ep->musb; in musb_alloc_request()
1275 request->epnum = musb_ep->current_epnum; in musb_alloc_request()
1276 request->ep = musb_ep; in musb_alloc_request()
1318 struct musb_ep *musb_ep; in musb_gadget_queue() local
1329 musb_ep = to_musb_ep(ep); in musb_gadget_queue()
1330 musb = musb_ep->musb; in musb_gadget_queue()
1335 if (request->ep != musb_ep) in musb_gadget_queue()
1343 request->epnum = musb_ep->current_epnum; in musb_gadget_queue()
1344 request->tx = musb_ep->is_in; in musb_gadget_queue()
1346 map_dma_buffer(request, musb, musb_ep); in musb_gadget_queue()
1351 if (!musb_ep->desc) { in musb_gadget_queue()
1359 list_add_tail(&request->list, &musb_ep->req_list); in musb_gadget_queue()
1362 if (!musb_ep->busy && &request->list == musb_ep->req_list.next) in musb_gadget_queue()
1372 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_dequeue() local
1377 struct musb *musb = musb_ep->musb; in musb_gadget_dequeue()
1379 if (!ep || !request || to_musb_request(request)->ep != musb_ep) in musb_gadget_dequeue()
1384 list_for_each_entry(r, &musb_ep->req_list, list) { in musb_gadget_dequeue()
1395 if (musb_ep->req_list.next != &req->list || musb_ep->busy) in musb_gadget_dequeue()
1396 musb_g_giveback(musb_ep, request, -ECONNRESET); in musb_gadget_dequeue()
1399 else if (is_dma_capable() && musb_ep->dma) { in musb_gadget_dequeue()
1402 musb_ep_select(musb->mregs, musb_ep->current_epnum); in musb_gadget_dequeue()
1404 status = c->channel_abort(musb_ep->dma); in musb_gadget_dequeue()
1408 musb_g_giveback(musb_ep, request, -ECONNRESET); in musb_gadget_dequeue()
1413 musb_g_giveback(musb_ep, request, -ECONNRESET); in musb_gadget_dequeue()
1429 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_set_halt() local
1430 u8 epnum = musb_ep->current_epnum; in musb_gadget_set_halt()
1431 struct musb *musb = musb_ep->musb; in musb_gadget_set_halt()
1445 if ((USB_ENDPOINT_XFER_ISOC == musb_ep->type)) { in musb_gadget_set_halt()
1452 request = next_request(musb_ep); in musb_gadget_set_halt()
1461 if (musb_ep->is_in) { in musb_gadget_set_halt()
1470 musb_ep->wedged = 0; in musb_gadget_set_halt()
1474 if (musb_ep->is_in) { in musb_gadget_set_halt()
1499 if (!musb_ep->busy && !value && request) { in musb_gadget_set_halt()
1515 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_set_wedge() local
1520 musb_ep->wedged = 1; in musb_gadget_set_wedge()
1528 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_fifo_status() local
1529 void __iomem *epio = musb_ep->hw_ep->regs; in musb_gadget_fifo_status()
1532 if (musb_ep->desc && !musb_ep->is_in) { in musb_gadget_fifo_status()
1533 struct musb *musb = musb_ep->musb; in musb_gadget_fifo_status()
1534 int epnum = musb_ep->current_epnum; in musb_gadget_fifo_status()
1551 struct musb_ep *musb_ep = to_musb_ep(ep); in musb_gadget_fifo_flush() local
1552 struct musb *musb = musb_ep->musb; in musb_gadget_fifo_flush()
1553 u8 epnum = musb_ep->current_epnum; in musb_gadget_fifo_flush()
1568 if (musb_ep->is_in) { in musb_gadget_fifo_flush()
1823 init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) in init_peripheral_ep()