Lines Matching refs:ep
254 static void s3c2410_udc_done(struct s3c2410_ep *ep, in s3c2410_udc_done() argument
257 unsigned halted = ep->halted; in s3c2410_udc_done()
266 ep->halted = 1; in s3c2410_udc_done()
267 usb_gadget_giveback_request(&ep->ep, &req->req); in s3c2410_udc_done()
268 ep->halted = halted; in s3c2410_udc_done()
272 struct s3c2410_ep *ep, int status) in s3c2410_udc_nuke() argument
275 if (&ep->queue == NULL) in s3c2410_udc_nuke()
278 while (!list_empty(&ep->queue)) { in s3c2410_udc_nuke()
280 req = list_entry(ep->queue.next, struct s3c2410_request, in s3c2410_udc_nuke()
282 s3c2410_udc_done(ep, req, status); in s3c2410_udc_nuke()
322 static int s3c2410_udc_write_fifo(struct s3c2410_ep *ep, in s3c2410_udc_write_fifo() argument
331 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_write_fifo()
352 count = s3c2410_udc_write_packet(fifo_reg, req, ep->ep.maxpacket); in s3c2410_udc_write_fifo()
355 if (count != ep->ep.maxpacket) in s3c2410_udc_write_fifo()
378 ep->dev->ep0state = EP0_IDLE; in s3c2410_udc_write_fifo()
387 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_write_fifo()
422 static int s3c2410_udc_read_fifo(struct s3c2410_ep *ep, in s3c2410_udc_read_fifo() argument
434 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_read_fifo()
471 if (fifo_count > ep->ep.maxpacket) in s3c2410_udc_read_fifo()
472 avail = ep->ep.maxpacket; in s3c2410_udc_read_fifo()
481 if (idx != 0 && fifo_count < ep->ep.maxpacket) { in s3c2410_udc_read_fifo()
501 ep->dev->ep0state = EP0_IDLE; in s3c2410_udc_read_fifo()
510 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_read_fifo()
602 struct s3c2410_ep *ep, in s3c2410_udc_handle_ep0_idle() argument
612 s3c2410_udc_nuke(dev, ep, -EPROTO); in s3c2410_udc_handle_ep0_idle()
683 s3c2410_udc_set_halt(&dev->ep[crq->wIndex & 0x7f].ep, 0); in s3c2410_udc_handle_ep0_idle()
696 s3c2410_udc_set_halt(&dev->ep[crq->wIndex & 0x7f].ep, 1); in s3c2410_udc_handle_ep0_idle()
744 struct s3c2410_ep *ep = &dev->ep[0]; in s3c2410_udc_handle_ep0() local
748 if (list_empty(&ep->queue)) in s3c2410_udc_handle_ep0()
751 req = list_entry(ep->queue.next, struct s3c2410_request, queue); in s3c2410_udc_handle_ep0()
764 s3c2410_udc_nuke(dev, ep, -EPIPE); in s3c2410_udc_handle_ep0()
774 s3c2410_udc_nuke(dev, ep, 0); in s3c2410_udc_handle_ep0()
781 s3c2410_udc_handle_ep0_idle(dev, ep, &crq, ep0csr); in s3c2410_udc_handle_ep0()
787 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep0()
793 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep0()
812 static void s3c2410_udc_handle_ep(struct s3c2410_ep *ep) in s3c2410_udc_handle_ep() argument
815 int is_in = ep->bEndpointAddress & USB_DIR_IN; in s3c2410_udc_handle_ep()
819 if (likely(!list_empty(&ep->queue))) in s3c2410_udc_handle_ep()
820 req = list_entry(ep->queue.next, in s3c2410_udc_handle_ep()
825 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_handle_ep()
842 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep()
856 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep()
918 udc_write((dev->ep[0].ep.maxpacket & 0x7ff) >> 3, in s3c2410_udc_irq()
984 s3c2410_udc_handle_ep(&dev->ep[i]); in s3c2410_udc_irq()
995 s3c2410_udc_handle_ep(&dev->ep[i]); in s3c2410_udc_irq()
1013 static inline struct s3c2410_ep *to_s3c2410_ep(struct usb_ep *ep) in to_s3c2410_ep() argument
1015 return container_of(ep, struct s3c2410_ep, ep); in to_s3c2410_ep()
1035 struct s3c2410_ep *ep; in s3c2410_udc_ep_enable() local
1041 ep = to_s3c2410_ep(_ep); in s3c2410_udc_ep_enable()
1048 dev = ep->dev; in s3c2410_udc_ep_enable()
1056 ep->ep.desc = desc; in s3c2410_udc_ep_enable()
1057 ep->halted = 0; in s3c2410_udc_ep_enable()
1058 ep->bEndpointAddress = desc->bEndpointAddress; in s3c2410_udc_ep_enable()
1061 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()
1071 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()
1080 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()
1088 udc_write(ep->num, S3C2410_UDC_INDEX_REG); in s3c2410_udc_ep_enable()
1094 udc_write(int_en_reg | (1 << ep->num), S3C2410_UDC_EP_INT_EN_REG); in s3c2410_udc_ep_enable()
1099 _ep->name, ep->num, tmp, in s3c2410_udc_ep_enable()
1113 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_ep_disable() local
1117 if (!_ep || !ep->ep.desc) { in s3c2410_udc_ep_disable()
1119 _ep ? ep->ep.name : NULL); in s3c2410_udc_ep_disable()
1127 ep->ep.desc = NULL; in s3c2410_udc_ep_disable()
1128 ep->halted = 1; in s3c2410_udc_ep_disable()
1130 s3c2410_udc_nuke(ep->dev, ep, -ESHUTDOWN); in s3c2410_udc_ep_disable()
1134 udc_write(int_en_reg & ~(1<<ep->num), S3C2410_UDC_EP_INT_EN_REG); in s3c2410_udc_ep_disable()
1170 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_free_request() local
1175 if (!ep || !_req || (!ep->ep.desc && _ep->name != ep0name)) in s3c2410_udc_free_request()
1189 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_queue() local
1195 if (unlikely(!_ep || (!ep->ep.desc && ep->ep.name != ep0name))) { in s3c2410_udc_queue()
1200 dev = ep->dev; in s3c2410_udc_queue()
1226 __func__, ep->bEndpointAddress, _req->length); in s3c2410_udc_queue()
1228 if (ep->bEndpointAddress) { in s3c2410_udc_queue()
1229 udc_write(ep->bEndpointAddress & 0x7F, S3C2410_UDC_INDEX_REG); in s3c2410_udc_queue()
1231 ep_csr = udc_read((ep->bEndpointAddress & USB_DIR_IN) in s3c2410_udc_queue()
1242 if (list_empty(&ep->queue) && !ep->halted) { in s3c2410_udc_queue()
1243 if (ep->bEndpointAddress == 0 /* ep0 */) { in s3c2410_udc_queue()
1247 && s3c2410_udc_write_fifo(ep, in s3c2410_udc_queue()
1257 && s3c2410_udc_read_fifo(ep, in s3c2410_udc_queue()
1268 } else if ((ep->bEndpointAddress & USB_DIR_IN) != 0 in s3c2410_udc_queue()
1270 && s3c2410_udc_write_fifo(ep, req)) { in s3c2410_udc_queue()
1274 && s3c2410_udc_read_fifo(ep, req)) { in s3c2410_udc_queue()
1281 list_add_tail(&req->queue, &ep->queue); in s3c2410_udc_queue()
1294 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_dequeue() local
1308 udc = to_s3c2410_udc(ep->gadget); in s3c2410_udc_dequeue()
1312 list_for_each_entry(req, &ep->queue, queue) { in s3c2410_udc_dequeue()
1326 s3c2410_udc_done(ep, req, -ECONNRESET); in s3c2410_udc_dequeue()
1338 struct s3c2410_ep *ep = to_s3c2410_ep(_ep); in s3c2410_udc_set_halt() local
1343 if (unlikely(!_ep || (!ep->ep.desc && ep->ep.name != ep0name))) { in s3c2410_udc_set_halt()
1350 idx = ep->bEndpointAddress & 0x7F; in s3c2410_udc_set_halt()
1357 ep_csr = udc_read((ep->bEndpointAddress & USB_DIR_IN) in s3c2410_udc_set_halt()
1361 if ((ep->bEndpointAddress & USB_DIR_IN) != 0) { in s3c2410_udc_set_halt()
1384 ep->halted = value ? 1 : 0; in s3c2410_udc_set_halt()
1604 struct s3c2410_ep *ep = &dev->ep[i]; in s3c2410_udc_reinit() local
1607 list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list); in s3c2410_udc_reinit()
1609 ep->dev = dev; in s3c2410_udc_reinit()
1610 ep->ep.desc = NULL; in s3c2410_udc_reinit()
1611 ep->halted = 0; in s3c2410_udc_reinit()
1612 INIT_LIST_HEAD(&ep->queue); in s3c2410_udc_reinit()
1613 usb_ep_set_maxpacket_limit(&ep->ep, ep->ep.maxpacket); in s3c2410_udc_reinit()
1632 udc_write((dev->ep[i].ep.maxpacket & 0x7ff) >> 3, in s3c2410_udc_enable()
1682 .ep0 = &memory.ep[0].ep,
1690 .ep[0] = {
1692 .ep = {
1701 .ep[1] = {
1703 .ep = {
1713 .ep[2] = {
1715 .ep = {
1725 .ep[3] = {
1727 .ep = {
1737 .ep[4] = {
1739 .ep = {
1786 memory.ep[1].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()
1787 memory.ep[2].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()
1788 memory.ep[3].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()
1789 memory.ep[4].fifo_size = S3C2440_EP_FIFO_SIZE; in s3c2410_udc_probe()