Lines Matching refs:ep

118 static void use_ep(struct omap_ep *ep, u16 select)  in use_ep()  argument
120 u16 num = ep->bEndpointAddress & 0x0f; in use_ep()
122 if (ep->bEndpointAddress & USB_DIR_IN) in use_ep()
138 static void dma_channel_claim(struct omap_ep *ep, unsigned preferred);
145 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep); in omap_ep_enable() local
153 || ep->bEndpointAddress != desc->bEndpointAddress in omap_ep_enable()
154 || ep->maxpacket < usb_endpoint_maxp(desc)) { in omap_ep_enable()
160 && maxp != ep->maxpacket) in omap_ep_enable()
161 || usb_endpoint_maxp(desc) > ep->maxpacket in omap_ep_enable()
183 if (ep->bmAttributes != desc->bmAttributes in omap_ep_enable()
184 && ep->bmAttributes != USB_ENDPOINT_XFER_BULK in omap_ep_enable()
190 udc = ep->udc; in omap_ep_enable()
198 ep->ep.desc = desc; in omap_ep_enable()
199 ep->irqs = 0; in omap_ep_enable()
200 ep->stopped = 0; in omap_ep_enable()
201 ep->ep.maxpacket = maxp; in omap_ep_enable()
204 ep->dma_channel = 0; in omap_ep_enable()
205 ep->has_dma = 0; in omap_ep_enable()
206 ep->lch = -1; in omap_ep_enable()
207 use_ep(ep, UDC_EP_SEL); in omap_ep_enable()
209 ep->ackwait = 0; in omap_ep_enable()
212 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) in omap_ep_enable()
213 list_add(&ep->iso, &udc->iso); in omap_ep_enable()
218 dma_channel_claim(ep, 0); in omap_ep_enable()
222 && !ep->has_dma in omap_ep_enable()
223 && !(ep->bEndpointAddress & USB_DIR_IN)) { in omap_ep_enable()
225 ep->ackwait = 1 + ep->double_buf; in omap_ep_enable()
237 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep); in omap_ep_disable() local
240 if (!_ep || !ep->ep.desc) { in omap_ep_disable()
242 _ep ? ep->ep.name : NULL); in omap_ep_disable()
246 spin_lock_irqsave(&ep->udc->lock, flags); in omap_ep_disable()
247 ep->ep.desc = NULL; in omap_ep_disable()
248 nuke(ep, -ESHUTDOWN); in omap_ep_disable()
249 ep->ep.maxpacket = ep->maxpacket; in omap_ep_disable()
250 ep->has_dma = 0; in omap_ep_disable()
252 list_del_init(&ep->iso); in omap_ep_disable()
253 del_timer(&ep->timer); in omap_ep_disable()
255 spin_unlock_irqrestore(&ep->udc->lock, flags); in omap_ep_disable()
264 omap_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) in omap_alloc_request() argument
278 omap_free_request(struct usb_ep *ep, struct usb_request *_req) in omap_free_request() argument
288 done(struct omap_ep *ep, struct omap_req *req, int status) in done() argument
290 struct omap_udc *udc = ep->udc; in done()
291 unsigned stopped = ep->stopped; in done()
300 if (use_dma && ep->has_dma) in done()
302 (ep->bEndpointAddress & USB_DIR_IN)); in done()
308 ep->ep.name, &req->req, status, in done()
312 ep->stopped = 1; in done()
313 spin_unlock(&ep->udc->lock); in done()
314 usb_gadget_giveback_request(&ep->ep, &req->req); in done()
315 spin_lock(&ep->udc->lock); in done()
316 ep->stopped = stopped; in done()
354 static int write_fifo(struct omap_ep *ep, struct omap_req *req) in write_fifo() argument
369 count = ep->ep.maxpacket; in write_fifo()
372 ep->ackwait = 1; in write_fifo()
375 if (count != ep->ep.maxpacket) in write_fifo()
388 done(ep, req, 0); in write_fifo()
416 static int read_fifo(struct omap_ep *ep, struct omap_req *req) in read_fifo() argument
430 if (!ep->double_buf) in read_fifo()
432 ep->fnf = 1; in read_fifo()
438 avail = ep->ep.maxpacket; in read_fifo()
441 ep->fnf = ep->double_buf; in read_fifo()
446 if (count < ep->ep.maxpacket) { in read_fifo()
460 if (!ep->bEndpointAddress) in read_fifo()
463 done(ep, req, 0); in read_fifo()
471 static u16 dma_src_len(struct omap_ep *ep, dma_addr_t start) in dma_src_len() argument
481 end = omap_get_dma_src_pos(ep->lch); in dma_src_len()
482 if (end == ep->dma_counter) in dma_src_len()
491 static u16 dma_dest_len(struct omap_ep *ep, dma_addr_t start) in dma_dest_len() argument
495 end = omap_get_dma_dst_pos(ep->lch); in dma_dest_len()
496 if (end == ep->dma_counter) in dma_dest_len()
513 static void next_in_dma(struct omap_ep *ep, struct omap_req *req) in next_in_dma() argument
524 || (cpu_is_omap15xx() && length < ep->maxpacket)) { in next_in_dma()
526 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8, in next_in_dma()
529 length = min(length / ep->maxpacket, in next_in_dma()
532 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16, in next_in_dma()
533 ep->ep.maxpacket >> 1, length, sync_mode, in next_in_dma()
535 length *= ep->maxpacket; in next_in_dma()
537 omap_set_dma_src_params(ep->lch, OMAP_DMA_PORT_EMIFF, in next_in_dma()
541 omap_start_dma(ep->lch); in next_in_dma()
542 ep->dma_counter = omap_get_dma_src_pos(ep->lch); in next_in_dma()
544 w |= UDC_TX_DONE_IE(ep->dma_channel); in next_in_dma()
546 omap_writew(UDC_TXN_START | txdma_ctrl, UDC_TXDMA(ep->dma_channel)); in next_in_dma()
550 static void finish_in_dma(struct omap_ep *ep, struct omap_req *req, int status) in finish_in_dma() argument
562 && (req->req.actual % ep->maxpacket) == 0) in finish_in_dma()
565 req->req.actual += dma_src_len(ep, req->req.dma in finish_in_dma()
569 omap_stop_dma(ep->lch); in finish_in_dma()
571 w &= ~UDC_TX_DONE_IE(ep->dma_channel); in finish_in_dma()
573 done(ep, req, status); in finish_in_dma()
576 static void next_out_dma(struct omap_ep *ep, struct omap_req *req) in next_out_dma() argument
583 packets /= ep->ep.maxpacket; in next_out_dma()
585 req->dma_bytes = packets * ep->ep.maxpacket; in next_out_dma()
586 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16, in next_out_dma()
587 ep->ep.maxpacket >> 1, packets, in next_out_dma()
590 omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF, in next_out_dma()
593 ep->dma_counter = omap_get_dma_dst_pos(ep->lch); in next_out_dma()
595 omap_writew(UDC_RXN_STOP | (packets - 1), UDC_RXDMA(ep->dma_channel)); in next_out_dma()
597 w |= UDC_RX_EOT_IE(ep->dma_channel); in next_out_dma()
599 omap_writew(ep->bEndpointAddress & 0xf, UDC_EP_NUM); in next_out_dma()
602 omap_start_dma(ep->lch); in next_out_dma()
606 finish_out_dma(struct omap_ep *ep, struct omap_req *req, int status, int one) in finish_out_dma() argument
611 ep->dma_counter = (u16) (req->req.dma + req->req.actual); in finish_out_dma()
612 count = dma_dest_len(ep, req->req.dma + req->req.actual); in finish_out_dma()
620 omap_stop_dma(ep->lch); in finish_out_dma()
628 w &= ~UDC_RX_EOT_IE(ep->dma_channel); in finish_out_dma()
630 done(ep, req, status); in finish_out_dma()
636 struct omap_ep *ep; in dma_irq() local
641 ep = &udc->ep[16 + UDC_DMA_TX_SRC(dman_stat)]; in dma_irq()
642 ep->irqs++; in dma_irq()
644 if (!list_empty(&ep->queue)) { in dma_irq()
645 req = container_of(ep->queue.next, in dma_irq()
647 finish_in_dma(ep, req, 0); in dma_irq()
651 if (!list_empty(&ep->queue)) { in dma_irq()
652 req = container_of(ep->queue.next, in dma_irq()
654 next_in_dma(ep, req); in dma_irq()
660 ep = &udc->ep[UDC_DMA_RX_SRC(dman_stat)]; in dma_irq()
661 ep->irqs++; in dma_irq()
663 if (!list_empty(&ep->queue)) { in dma_irq()
664 req = container_of(ep->queue.next, in dma_irq()
666 finish_out_dma(ep, req, 0, dman_stat & UDC_DMA_RX_SB); in dma_irq()
670 if (!list_empty(&ep->queue)) { in dma_irq()
671 req = container_of(ep->queue.next, in dma_irq()
673 next_out_dma(ep, req); in dma_irq()
678 ep = &udc->ep[UDC_DMA_RX_SRC(dman_stat)]; in dma_irq()
679 ep->irqs++; in dma_irq()
681 VDBG("%s, RX_CNT irq?\n", ep->ep.name); in dma_irq()
688 struct omap_ep *ep = data; in dma_error() local
692 ERR("%s dma error, lch %d status %02x\n", ep->ep.name, lch, ch_status); in dma_error()
697 static void dma_channel_claim(struct omap_ep *ep, unsigned channel) in dma_channel_claim() argument
703 is_in = ep->bEndpointAddress & USB_DIR_IN; in dma_channel_claim()
710 ep->dma_channel = 0; in dma_channel_claim()
711 ep->lch = -1; in dma_channel_claim()
724 reg |= (0x0f & ep->bEndpointAddress) << (4 * (channel - 1)); in dma_channel_claim()
725 ep->dma_channel = channel; in dma_channel_claim()
730 ep->ep.name, dma_error, ep, &ep->lch); in dma_channel_claim()
734 omap_set_dma_src_burst_mode(ep->lch, in dma_channel_claim()
736 omap_set_dma_src_data_pack(ep->lch, 1); in dma_channel_claim()
738 omap_set_dma_dest_params(ep->lch, in dma_channel_claim()
747 ep->ep.name, dma_error, ep, &ep->lch); in dma_channel_claim()
751 omap_set_dma_src_params(ep->lch, in dma_channel_claim()
757 omap_set_dma_dest_burst_mode(ep->lch, in dma_channel_claim()
759 omap_set_dma_dest_data_pack(ep->lch, 1); in dma_channel_claim()
763 ep->dma_channel = 0; in dma_channel_claim()
765 ep->has_dma = 1; in dma_channel_claim()
766 omap_disable_dma_irq(ep->lch, OMAP_DMA_BLOCK_IRQ); in dma_channel_claim()
770 omap_set_dma_channel_mode(ep->lch, OMAP_DMA_LCH_P); in dma_channel_claim()
775 restart = !ep->stopped && !list_empty(&ep->queue); in dma_channel_claim()
778 DBG("%s no dma channel: %d%s\n", ep->ep.name, status, in dma_channel_claim()
781 DBG("%s claimed %cxdma%d lch %d%s\n", ep->ep.name, in dma_channel_claim()
783 ep->dma_channel - 1, ep->lch, in dma_channel_claim()
788 req = container_of(ep->queue.next, struct omap_req, queue); in dma_channel_claim()
789 if (ep->has_dma) in dma_channel_claim()
790 (is_in ? next_in_dma : next_out_dma)(ep, req); in dma_channel_claim()
792 use_ep(ep, UDC_EP_SEL); in dma_channel_claim()
793 (is_in ? write_fifo : read_fifo)(ep, req); in dma_channel_claim()
797 ep->ackwait = 1 + ep->double_buf; in dma_channel_claim()
804 static void dma_channel_release(struct omap_ep *ep) in dma_channel_release() argument
806 int shift = 4 * (ep->dma_channel - 1); in dma_channel_release()
812 if (!list_empty(&ep->queue)) in dma_channel_release()
813 req = container_of(ep->queue.next, struct omap_req, queue); in dma_channel_release()
817 active = omap_get_dma_active_status(ep->lch); in dma_channel_release()
819 DBG("%s release %s %cxdma%d %p\n", ep->ep.name, in dma_channel_release()
821 (ep->bEndpointAddress & USB_DIR_IN) ? 't' : 'r', in dma_channel_release()
822 ep->dma_channel - 1, req); in dma_channel_release()
829 if (ep->bEndpointAddress & USB_DIR_IN) { in dma_channel_release()
834 finish_in_dma(ep, req, -ECONNRESET); in dma_channel_release()
837 use_ep(ep, UDC_EP_SEL); in dma_channel_release()
851 finish_out_dma(ep, req, -ECONNRESET, 0); in dma_channel_release()
853 omap_free_dma(ep->lch); in dma_channel_release()
854 ep->dma_channel = 0; in dma_channel_release()
855 ep->lch = -1; in dma_channel_release()
865 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep); in omap_ep_queue() local
877 if (!_ep || (!ep->ep.desc && ep->bEndpointAddress)) { in omap_ep_queue()
881 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) { in omap_ep_queue()
882 if (req->req.length > ep->ep.maxpacket) in omap_ep_queue()
891 && ep->has_dma in omap_ep_queue()
892 && ep->bEndpointAddress != 0 in omap_ep_queue()
893 && (ep->bEndpointAddress & USB_DIR_IN) == 0 in omap_ep_queue()
894 && (req->req.length % ep->ep.maxpacket) != 0) { in omap_ep_queue()
899 udc = ep->udc; in omap_ep_queue()
903 if (use_dma && ep->has_dma) in omap_ep_queue()
905 (ep->bEndpointAddress & USB_DIR_IN)); in omap_ep_queue()
908 ep->ep.name, _req, _req->length, _req->buf); in omap_ep_queue()
922 } else if (list_empty(&ep->queue) && !ep->stopped && !ep->ackwait) { in omap_ep_queue()
925 if (ep->bEndpointAddress == 0) { in omap_ep_queue()
926 if (!udc->ep0_pending || !list_empty(&ep->queue)) { in omap_ep_queue()
961 done(ep, req, 0); in omap_ep_queue()
974 is_in = ep->bEndpointAddress & USB_DIR_IN; in omap_ep_queue()
975 if (!ep->has_dma) in omap_ep_queue()
976 use_ep(ep, UDC_EP_SEL); in omap_ep_queue()
980 if (ep->has_dma) in omap_ep_queue()
981 (is_in ? next_in_dma : next_out_dma)(ep, req); in omap_ep_queue()
983 if ((is_in ? write_fifo : read_fifo)(ep, req) == 1) in omap_ep_queue()
988 ep->ackwait = 1 + ep->double_buf; in omap_ep_queue()
997 list_add_tail(&req->queue, &ep->queue); in omap_ep_queue()
1005 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep); in omap_ep_dequeue() local
1012 spin_lock_irqsave(&ep->udc->lock, flags); in omap_ep_dequeue()
1015 list_for_each_entry(req, &ep->queue, queue) { in omap_ep_dequeue()
1020 spin_unlock_irqrestore(&ep->udc->lock, flags); in omap_ep_dequeue()
1024 if (use_dma && ep->dma_channel && ep->queue.next == &req->queue) { in omap_ep_dequeue()
1025 int channel = ep->dma_channel; in omap_ep_dequeue()
1030 dma_channel_release(ep); in omap_ep_dequeue()
1031 dma_channel_claim(ep, channel); in omap_ep_dequeue()
1033 done(ep, req, -ECONNRESET); in omap_ep_dequeue()
1034 spin_unlock_irqrestore(&ep->udc->lock, flags); in omap_ep_dequeue()
1042 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep); in omap_ep_set_halt() local
1046 spin_lock_irqsave(&ep->udc->lock, flags); in omap_ep_set_halt()
1049 if (ep->bEndpointAddress == 0) { in omap_ep_set_halt()
1050 if (!ep->udc->ep0_pending) in omap_ep_set_halt()
1053 if (ep->udc->ep0_set_config) { in omap_ep_set_halt()
1058 ep->udc->ep0_pending = 0; in omap_ep_set_halt()
1064 } else if (ep->bmAttributes != USB_ENDPOINT_XFER_ISOC && ep->ep.desc) { in omap_ep_set_halt()
1067 if ((ep->bEndpointAddress & USB_DIR_IN) in omap_ep_set_halt()
1068 && !list_empty(&ep->queue)) { in omap_ep_set_halt()
1076 if (use_dma && ep->dma_channel in omap_ep_set_halt()
1077 && !list_empty(&ep->queue)) { in omap_ep_set_halt()
1078 channel = ep->dma_channel; in omap_ep_set_halt()
1079 dma_channel_release(ep); in omap_ep_set_halt()
1083 use_ep(ep, UDC_EP_SEL); in omap_ep_set_halt()
1092 dma_channel_claim(ep, channel); in omap_ep_set_halt()
1094 use_ep(ep, 0); in omap_ep_set_halt()
1095 omap_writew(ep->udc->clr_halt, UDC_CTRL); in omap_ep_set_halt()
1096 ep->ackwait = 0; in omap_ep_set_halt()
1097 if (!(ep->bEndpointAddress & USB_DIR_IN)) { in omap_ep_set_halt()
1099 ep->ackwait = 1 + ep->double_buf; in omap_ep_set_halt()
1104 VDBG("%s %s halt stat %d\n", ep->ep.name, in omap_ep_set_halt()
1107 spin_unlock_irqrestore(&ep->udc->lock, flags); in omap_ep_set_halt()
1327 static void nuke(struct omap_ep *ep, int status) in nuke() argument
1331 ep->stopped = 1; in nuke()
1333 if (use_dma && ep->dma_channel) in nuke()
1334 dma_channel_release(ep); in nuke()
1336 use_ep(ep, 0); in nuke()
1338 if (ep->bEndpointAddress && ep->bmAttributes != USB_ENDPOINT_XFER_ISOC) in nuke()
1341 while (!list_empty(&ep->queue)) { in nuke()
1342 req = list_entry(ep->queue.next, struct omap_req, queue); in nuke()
1343 done(ep, req, status); in nuke()
1350 struct omap_ep *ep; in udc_quiesce() local
1353 nuke(&udc->ep[0], -ESHUTDOWN); in udc_quiesce()
1354 list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) in udc_quiesce()
1355 nuke(ep, -ESHUTDOWN); in udc_quiesce()
1391 struct omap_ep *ep0 = &udc->ep[0]; in ep0_irq()
1511 struct omap_ep *ep; in ep0_irq() local
1565 ep = &udc->ep[w_index & 0xf]; in ep0_irq()
1566 if (ep != ep0) { in ep0_irq()
1568 ep += 16; in ep0_irq()
1569 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC in ep0_irq()
1570 || !ep->ep.desc) in ep0_irq()
1572 use_ep(ep, 0); in ep0_irq()
1574 ep->ackwait = 0; in ep0_irq()
1575 if (!(ep->bEndpointAddress & USB_DIR_IN)) { in ep0_irq()
1577 ep->ackwait = 1 + ep->double_buf; in ep0_irq()
1585 VDBG("%s halt cleared by host\n", ep->name); in ep0_irq()
1594 ep = &udc->ep[w_index & 0xf]; in ep0_irq()
1596 ep += 16; in ep0_irq()
1597 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC in ep0_irq()
1598 || ep == ep0 || !ep->ep.desc) in ep0_irq()
1600 if (use_dma && ep->has_dma) { in ep0_irq()
1604 DBG("%s host set_halt, NYET\n", ep->name); in ep0_irq()
1607 use_ep(ep, 0); in ep0_irq()
1611 VDBG("%s halted by host\n", ep->name); in ep0_irq()
1630 ep = &udc->ep[w_index & 0xf]; in ep0_irq()
1632 ep += 16; in ep0_irq()
1633 if (!ep->ep.desc) in ep0_irq()
1637 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) in ep0_irq()
1641 ERR("%s status, can't report\n", ep->ep.name); in ep0_irq()
1859 struct omap_ep *ep = from_timer(ep, t, timer); in pio_out_timer() local
1863 spin_lock_irqsave(&ep->udc->lock, flags); in pio_out_timer()
1864 if (!list_empty(&ep->queue) && ep->ackwait) { in pio_out_timer()
1865 use_ep(ep, UDC_EP_SEL); in pio_out_timer()
1869 || (ep->double_buf && HALF_FULL(stat_flg)))) { in pio_out_timer()
1872 VDBG("%s: lose, %04x\n", ep->ep.name, stat_flg); in pio_out_timer()
1873 req = container_of(ep->queue.next, in pio_out_timer()
1875 (void) read_fifo(ep, req); in pio_out_timer()
1876 omap_writew(ep->bEndpointAddress, UDC_EP_NUM); in pio_out_timer()
1878 ep->ackwait = 1 + ep->double_buf; in pio_out_timer()
1882 mod_timer(&ep->timer, PIO_OUT_TIMEOUT); in pio_out_timer()
1883 spin_unlock_irqrestore(&ep->udc->lock, flags); in pio_out_timer()
1890 struct omap_ep *ep; in omap_udc_pio_irq() local
1905 ep = &udc->ep[epnum]; in omap_udc_pio_irq()
1906 ep->irqs++; in omap_udc_pio_irq()
1909 ep->fnf = 0; in omap_udc_pio_irq()
1911 ep->ackwait--; in omap_udc_pio_irq()
1912 if (!list_empty(&ep->queue)) { in omap_udc_pio_irq()
1914 req = container_of(ep->queue.next, in omap_udc_pio_irq()
1916 stat = read_fifo(ep, req); in omap_udc_pio_irq()
1917 if (!ep->double_buf) in omap_udc_pio_irq()
1918 ep->fnf = 1; in omap_udc_pio_irq()
1929 if (ep->fnf) { in omap_udc_pio_irq()
1931 ep->ackwait = 1 + ep->double_buf; in omap_udc_pio_irq()
1933 mod_timer(&ep->timer, PIO_OUT_TIMEOUT); in omap_udc_pio_irq()
1941 ep = &udc->ep[16 + epnum]; in omap_udc_pio_irq()
1942 ep->irqs++; in omap_udc_pio_irq()
1946 ep->ackwait = 0; in omap_udc_pio_irq()
1947 if (!list_empty(&ep->queue)) { in omap_udc_pio_irq()
1948 req = container_of(ep->queue.next, in omap_udc_pio_irq()
1950 (void) write_fifo(ep, req); in omap_udc_pio_irq()
1968 struct omap_ep *ep; in omap_udc_iso_irq() local
1975 list_for_each_entry(ep, &udc->iso, iso) { in omap_udc_iso_irq()
1979 if (ep->has_dma || list_empty(&ep->queue)) in omap_udc_iso_irq()
1981 req = list_entry(ep->queue.next, struct omap_req, queue); in omap_udc_iso_irq()
1983 use_ep(ep, UDC_EP_SEL); in omap_udc_iso_irq()
1989 if (ep->bEndpointAddress & USB_DIR_IN) { in omap_udc_iso_irq()
1993 write_fifo(ep, req); in omap_udc_iso_irq()
2007 read_fifo(ep, req); in omap_udc_iso_irq()
2012 ep->irqs++; in omap_udc_iso_irq()
2013 if (!list_empty(&ep->queue)) in omap_udc_iso_irq()
2046 struct omap_ep *ep; in omap_udc_start() local
2052 list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { in omap_udc_start()
2053 ep->irqs = 0; in omap_udc_start()
2054 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) in omap_udc_start()
2056 use_ep(ep, 0); in omap_udc_start()
2060 udc->ep[0].irqs = 0; in omap_udc_start()
2141 static void proc_ep_show(struct seq_file *s, struct omap_ep *ep) in proc_ep_show() argument
2147 use_ep(ep, 0); in proc_ep_show()
2149 if (use_dma && ep->has_dma) in proc_ep_show()
2151 (ep->bEndpointAddress & USB_DIR_IN) ? 't' : 'r', in proc_ep_show()
2152 ep->dma_channel - 1, ep->lch); in proc_ep_show()
2159 ep->name, buf, in proc_ep_show()
2160 ep->double_buf ? "dbuf " : "", in proc_ep_show()
2162 switch (ep->ackwait) { in proc_ep_show()
2176 ep->irqs, stat_flg, in proc_ep_show()
2191 if (list_empty(&ep->queue)) in proc_ep_show()
2194 list_for_each_entry(req, &ep->queue, queue) { in proc_ep_show()
2198 length += ((ep->bEndpointAddress & USB_DIR_IN) in proc_ep_show()
2200 (ep, req->req.dma + length); in proc_ep_show()
2297 struct omap_ep *ep; in proc_udc_show() local
2423 proc_ep_show(s, &udc->ep[0]); in proc_udc_show()
2425 list_for_each_entry(ep, &udc->gadget.ep_list, in proc_udc_show()
2426 ep.ep_list) { in proc_udc_show()
2427 if (ep->ep.desc) in proc_udc_show()
2428 proc_ep_show(s, ep); in proc_udc_show()
2467 struct omap_ep *ep; in omap_ep_setup() local
2471 ep = &udc->ep[addr & 0xf]; in omap_ep_setup()
2473 ep += 16; in omap_ep_setup()
2476 BUG_ON(ep->name[0]); in omap_ep_setup()
2533 timer_setup(&ep->timer, pio_out_timer, 0); in omap_ep_setup()
2555 BUG_ON(strlen(name) >= sizeof ep->name); in omap_ep_setup()
2556 strlcpy(ep->name, name, sizeof ep->name); in omap_ep_setup()
2557 INIT_LIST_HEAD(&ep->queue); in omap_ep_setup()
2558 INIT_LIST_HEAD(&ep->iso); in omap_ep_setup()
2559 ep->bEndpointAddress = addr; in omap_ep_setup()
2560 ep->bmAttributes = type; in omap_ep_setup()
2561 ep->double_buf = dbuf; in omap_ep_setup()
2562 ep->udc = udc; in omap_ep_setup()
2566 ep->ep.caps.type_control = true; in omap_ep_setup()
2567 ep->ep.caps.dir_in = true; in omap_ep_setup()
2568 ep->ep.caps.dir_out = true; in omap_ep_setup()
2571 ep->ep.caps.type_iso = true; in omap_ep_setup()
2574 ep->ep.caps.type_bulk = true; in omap_ep_setup()
2577 ep->ep.caps.type_int = true; in omap_ep_setup()
2582 ep->ep.caps.dir_in = true; in omap_ep_setup()
2584 ep->ep.caps.dir_out = true; in omap_ep_setup()
2586 ep->ep.name = ep->name; in omap_ep_setup()
2587 ep->ep.ops = &omap_ep_ops; in omap_ep_setup()
2588 ep->maxpacket = maxp; in omap_ep_setup()
2589 usb_ep_set_maxpacket_limit(&ep->ep, ep->maxpacket); in omap_ep_setup()
2590 list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); in omap_ep_setup()
2638 udc->gadget.ep0 = &udc->ep[0].ep; in omap_udc_setup()
2650 list_del_init(&udc->ep[0].ep.ep_list); in omap_udc_setup()