Lines Matching refs:ep
252 static void s3c2410_udc_done(struct s3c2410_ep *ep, in s3c2410_udc_done() argument
255 unsigned halted = ep->halted; in s3c2410_udc_done()
264 ep->halted = 1; in s3c2410_udc_done()
265 usb_gadget_giveback_request(&ep->ep, &req->req); in s3c2410_udc_done()
266 ep->halted = halted; in s3c2410_udc_done()
270 struct s3c2410_ep *ep, int status) in s3c2410_udc_nuke() argument
273 if (&ep->queue == NULL) in s3c2410_udc_nuke()
276 while (!list_empty(&ep->queue)) { in s3c2410_udc_nuke()
278 req = list_entry(ep->queue.next, struct s3c2410_request, in s3c2410_udc_nuke()
280 s3c2410_udc_done(ep, req, status); in s3c2410_udc_nuke()
320 static int s3c2410_udc_write_fifo(struct s3c2410_ep *ep, in s3c2410_udc_write_fifo() argument
329 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_write_fifo()
350 count = s3c2410_udc_write_packet(fifo_reg, req, ep->ep.maxpacket); in s3c2410_udc_write_fifo()
353 if (count != ep->ep.maxpacket) in s3c2410_udc_write_fifo()
376 ep->dev->ep0state = EP0_IDLE; in s3c2410_udc_write_fifo()
385 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_write_fifo()
420 static int s3c2410_udc_read_fifo(struct s3c2410_ep *ep, in s3c2410_udc_read_fifo() argument
432 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_read_fifo()
469 if (fifo_count > ep->ep.maxpacket) in s3c2410_udc_read_fifo()
470 avail = ep->ep.maxpacket; in s3c2410_udc_read_fifo()
479 if (idx != 0 && fifo_count < ep->ep.maxpacket) { in s3c2410_udc_read_fifo()
499 ep->dev->ep0state = EP0_IDLE; in s3c2410_udc_read_fifo()
508 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_read_fifo()
600 struct s3c2410_ep *ep, in s3c2410_udc_handle_ep0_idle() argument
610 s3c2410_udc_nuke(dev, ep, -EPROTO); in s3c2410_udc_handle_ep0_idle()
681 s3c2410_udc_set_halt(&dev->ep[crq->wIndex & 0x7f].ep, 0); in s3c2410_udc_handle_ep0_idle()
694 s3c2410_udc_set_halt(&dev->ep[crq->wIndex & 0x7f].ep, 1); in s3c2410_udc_handle_ep0_idle()
742 struct s3c2410_ep *ep = &dev->ep[0]; in s3c2410_udc_handle_ep0() local
746 if (list_empty(&ep->queue)) in s3c2410_udc_handle_ep0()
749 req = list_entry(ep->queue.next, struct s3c2410_request, queue); in s3c2410_udc_handle_ep0()
762 s3c2410_udc_nuke(dev, ep, -EPIPE); in s3c2410_udc_handle_ep0()
772 s3c2410_udc_nuke(dev, ep, 0); in s3c2410_udc_handle_ep0()
779 s3c2410_udc_handle_ep0_idle(dev, ep, &crq, ep0csr); in s3c2410_udc_handle_ep0()
785 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep0()
791 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep0()
810 static void s3c2410_udc_handle_ep(struct s3c2410_ep *ep) in s3c2410_udc_handle_ep() argument
813 int is_in = ep->bEndpointAddress & USB_DIR_IN; in s3c2410_udc_handle_ep()
817 if (likely(!list_empty(&ep->queue))) in s3c2410_udc_handle_ep()
818 req = list_entry(ep->queue.next, in s3c2410_udc_handle_ep()
823 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_handle_ep()
840 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep()
854 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep()
916 udc_write((dev->ep[0].ep.maxpacket & 0x7ff) >> 3, in s3c2410_udc_irq()
982 s3c2410_udc_handle_ep(&dev->ep[i]); in s3c2410_udc_irq()
993 s3c2410_udc_handle_ep(&dev->ep[i]); in s3c2410_udc_irq()
1011 static inline struct s3c2410_ep *to_s3c2410_ep(struct usb_ep *ep) in to_s3c2410_ep() argument
1013 return container_of(ep, struct s3c2410_ep, ep); in to_s3c2410_ep()
1033 struct s3c2410_ep *ep; in s3c2410_udc_ep_enable() local
1039 ep = to_s3c2410_ep(_ep); in s3c2410_udc_ep_enable()
1046 dev = ep->dev; in s3c2410_udc_ep_enable()
1054 ep->ep.desc = desc; in s3c2410_udc_ep_enable()
1055 ep->halted = 0; in s3c2410_udc_ep_enable()
1056 ep->bEndpointAddress = desc->bEndpointAddress; in s3c2410_udc_ep_enable()
1059 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1067 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1069 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1076 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1078 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1084 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1086 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1092 udc_write(int_en_reg | (1 << ep->num), S3C2410_UDC_EP_INT_EN_REG); in s3c2410_udc_ep_enable()
1097 _ep->name, ep->num, tmp, in s3c2410_udc_ep_enable()
1111 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_ep_disable() local
1115 if (!_ep || !ep->ep.desc) { in s3c2410_udc_ep_disable()
1117 _ep ? ep->ep.name : NULL); in s3c2410_udc_ep_disable()
1125 ep->ep.desc = NULL; in s3c2410_udc_ep_disable()
1126 ep->halted = 1; in s3c2410_udc_ep_disable()
1128 s3c2410_udc_nuke(ep->dev, ep, -ESHUTDOWN); in s3c2410_udc_ep_disable()
1132 udc_write(int_en_reg & ~(1<<ep->num), S3C2410_UDC_EP_INT_EN_REG); in s3c2410_udc_ep_disable()
1168 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_free_request() local
1173 if (!ep || !_req || (!ep->ep.desc && _ep->name != ep0name)) in s3c2410_udc_free_request()
1187 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_queue() local
1193 if (unlikely(!_ep || (!ep->ep.desc && ep->ep.name != ep0name))) { in s3c2410_udc_queue()
1198 dev = ep->dev; in s3c2410_udc_queue()
1224 __func__, ep->bEndpointAddress, _req->length); in s3c2410_udc_queue()
1226 if (ep->bEndpointAddress) { in s3c2410_udc_queue()
1227 udc_write(ep->bEndpointAddress & 0x7F, S3C2410_UDC_INDEX_REG); in s3c2410_udc_queue()
1229 ep_csr = udc_read((ep->bEndpointAddress & USB_DIR_IN) in s3c2410_udc_queue()
1240 if (list_empty(&ep->queue) && !ep->halted) { in s3c2410_udc_queue()
1241 if (ep->bEndpointAddress == 0 /* ep0 */) { in s3c2410_udc_queue()
1245 && s3c2410_udc_write_fifo(ep, in s3c2410_udc_queue()
1255 && s3c2410_udc_read_fifo(ep, in s3c2410_udc_queue()
1266 } else if ((ep->bEndpointAddress & USB_DIR_IN) != 0 in s3c2410_udc_queue()
1268 && s3c2410_udc_write_fifo(ep, req)) { in s3c2410_udc_queue()
1272 && s3c2410_udc_read_fifo(ep, req)) { in s3c2410_udc_queue()
1279 list_add_tail(&req->queue, &ep->queue); in s3c2410_udc_queue()
1292 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_dequeue() local
1306 udc = to_s3c2410_udc(ep->gadget); in s3c2410_udc_dequeue()
1310 list_for_each_entry(req, &ep->queue, queue) { in s3c2410_udc_dequeue()
1324 s3c2410_udc_done(ep, req, -ECONNRESET); in s3c2410_udc_dequeue()
1336 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_set_halt() local
1341 if (unlikely(!_ep || (!ep->ep.desc && ep->ep.name != ep0name))) { in s3c2410_udc_set_halt()
1348 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_set_halt()
1355 ep_csr = udc_read((ep->bEndpointAddress & USB_DIR_IN) in s3c2410_udc_set_halt()
1359 if ((ep->bEndpointAddress & USB_DIR_IN) != 0) { in s3c2410_udc_set_halt()
1382 ep->halted = value ? 1 : 0; in s3c2410_udc_set_halt()
1602 struct s3c2410_ep *ep = &dev->ep[i]; in s3c2410_udc_reinit() local
1605 list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list); in s3c2410_udc_reinit()
1607 ep->dev = dev; in s3c2410_udc_reinit()
1608 ep->ep.desc = NULL; in s3c2410_udc_reinit()
1609 ep->halted = 0; in s3c2410_udc_reinit()
1610 INIT_LIST_HEAD(&ep->queue); in s3c2410_udc_reinit()
1611 usb_ep_set_maxpacket_limit(&ep->ep, ep->ep.maxpacket); in s3c2410_udc_reinit()
1630 udc_write((dev->ep[i].ep.maxpacket & 0x7ff) >> 3, in s3c2410_udc_enable()
1680 .ep0 = &memory.ep[0].ep,
1688 .ep[0] = {
1690 .ep = {
1701 .ep[1] = {
1703 .ep = {
1715 .ep[2] = {
1717 .ep = {
1729 .ep[3] = {
1731 .ep = {
1743 .ep[4] = {
1745 .ep = {
1794 memory.ep[1].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()
1795 memory.ep[2].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()
1796 memory.ep[3].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()
1797 memory.ep[4].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()