• Home
  • Raw
  • Download

Lines Matching refs:ep

79 static void handle_ep(struct pxa_ep *ep);
139 struct pxa_ep *ep; in queues_dbg_show() local
148 ep = &udc->pxa_ep[i]; in queues_dbg_show()
149 maxpkt = ep->fifo_size; in queues_dbg_show()
151 EPNAME(ep), maxpkt, "pio"); in queues_dbg_show()
153 if (list_empty(&ep->queue)) { in queues_dbg_show()
158 list_for_each_entry(req, &ep->queue, queue) { in queues_dbg_show()
172 struct pxa_ep *ep; in eps_dbg_show() local
179 ep = &udc->pxa_ep[0]; in eps_dbg_show()
180 tmp = udc_ep_readl(ep, UDCCSR); in eps_dbg_show()
191 ep = &udc->pxa_ep[i]; in eps_dbg_show()
192 tmp = i? udc_ep_readl(ep, UDCCR) : udc_readl(udc, UDCCR); in eps_dbg_show()
194 EPNAME(ep), in eps_dbg_show()
195 ep->stats.in_bytes, ep->stats.in_ops, in eps_dbg_show()
196 ep->stats.out_bytes, ep->stats.out_ops, in eps_dbg_show()
197 ep->stats.irqs, in eps_dbg_show()
198 tmp, udc_ep_readl(ep, UDCCSR), in eps_dbg_show()
199 udc_ep_readl(ep, UDCBCR)); in eps_dbg_show()
243 static int is_match_usb_pxa(struct udc_usb_ep *udc_usb_ep, struct pxa_ep *ep, in is_match_usb_pxa() argument
246 if (usb_endpoint_num(&udc_usb_ep->desc) != ep->addr) in is_match_usb_pxa()
248 if (usb_endpoint_dir_in(&udc_usb_ep->desc) != ep->dir_in) in is_match_usb_pxa()
250 if (usb_endpoint_type(&udc_usb_ep->desc) != ep->type) in is_match_usb_pxa()
252 if ((ep->config != config) || (ep->interface != interface) in is_match_usb_pxa()
253 || (ep->alternate != altsetting)) in is_match_usb_pxa()
287 struct pxa_ep *ep; in find_pxa_ep() local
296 ep = &udc->pxa_ep[i]; in find_pxa_ep()
297 if (is_match_usb_pxa(udc_usb_ep, ep, cfg, iface, alt)) in find_pxa_ep()
298 return ep; in find_pxa_ep()
329 static void pio_irq_enable(struct pxa_ep *ep) in pio_irq_enable() argument
331 struct pxa_udc *udc = ep->dev; in pio_irq_enable()
332 int index = EPIDX(ep); in pio_irq_enable()
346 static void pio_irq_disable(struct pxa_ep *ep) in pio_irq_disable() argument
348 struct pxa_udc *udc = ep->dev; in pio_irq_disable()
349 int index = EPIDX(ep); in pio_irq_disable()
397 static inline void ep_write_UDCCSR(struct pxa_ep *ep, int mask) in ep_write_UDCCSR() argument
399 if (is_ep0(ep)) in ep_write_UDCCSR()
401 udc_ep_writel(ep, UDCCSR, mask); in ep_write_UDCCSR()
410 static int ep_count_bytes_remain(struct pxa_ep *ep) in ep_count_bytes_remain() argument
412 if (ep->dir_in) in ep_count_bytes_remain()
414 return udc_ep_readl(ep, UDCBCR) & 0x3ff; in ep_count_bytes_remain()
427 static int ep_is_empty(struct pxa_ep *ep) in ep_is_empty() argument
431 if (!is_ep0(ep) && ep->dir_in) in ep_is_empty()
433 if (is_ep0(ep)) in ep_is_empty()
434 ret = !(udc_ep_readl(ep, UDCCSR) & UDCCSR0_RNE); in ep_is_empty()
436 ret = !(udc_ep_readl(ep, UDCCSR) & UDCCSR_BNE); in ep_is_empty()
449 static int ep_is_full(struct pxa_ep *ep) in ep_is_full() argument
451 if (is_ep0(ep)) in ep_is_full()
452 return (udc_ep_readl(ep, UDCCSR) & UDCCSR0_IPR); in ep_is_full()
453 if (!ep->dir_in) in ep_is_full()
455 return (!(udc_ep_readl(ep, UDCCSR) & UDCCSR_BNF)); in ep_is_full()
464 static int epout_has_pkt(struct pxa_ep *ep) in epout_has_pkt() argument
466 if (!is_ep0(ep) && ep->dir_in) in epout_has_pkt()
468 if (is_ep0(ep)) in epout_has_pkt()
469 return (udc_ep_readl(ep, UDCCSR) & UDCCSR0_OPC); in epout_has_pkt()
470 return (udc_ep_readl(ep, UDCCSR) & UDCCSR_PC); in epout_has_pkt()
480 struct pxa_ep *ep = &udc->pxa_ep[0]; in set_ep0state() local
484 ep_dbg(ep, "state=%s->%s, udccsr0=0x%03x, udcbcr=%d\n", old_stname, in set_ep0state()
485 EP0_STNAME(udc), udc_ep_readl(ep, UDCCSR), in set_ep0state()
486 udc_ep_readl(ep, UDCBCR)); in set_ep0state()
504 static void inc_ep_stats_reqs(struct pxa_ep *ep, int is_in) in inc_ep_stats_reqs() argument
507 ep->stats.in_ops++; in inc_ep_stats_reqs()
509 ep->stats.out_ops++; in inc_ep_stats_reqs()
518 static void inc_ep_stats_bytes(struct pxa_ep *ep, int count, int is_in) in inc_ep_stats_bytes() argument
521 ep->stats.in_bytes += count; in inc_ep_stats_bytes()
523 ep->stats.out_bytes += count; in inc_ep_stats_bytes()
532 static void pxa_ep_setup(struct pxa_ep *ep) in pxa_ep_setup() argument
536 new_udccr = ((ep->config << UDCCONR_CN_S) & UDCCONR_CN) in pxa_ep_setup()
537 | ((ep->interface << UDCCONR_IN_S) & UDCCONR_IN) in pxa_ep_setup()
538 | ((ep->alternate << UDCCONR_AISN_S) & UDCCONR_AISN) in pxa_ep_setup()
539 | ((EPADDR(ep) << UDCCONR_EN_S) & UDCCONR_EN) in pxa_ep_setup()
540 | ((EPXFERTYPE(ep) << UDCCONR_ET_S) & UDCCONR_ET) in pxa_ep_setup()
541 | ((ep->dir_in) ? UDCCONR_ED : 0) in pxa_ep_setup()
542 | ((ep->fifo_size << UDCCONR_MPS_S) & UDCCONR_MPS) in pxa_ep_setup()
545 udc_ep_writel(ep, UDCCR, new_udccr); in pxa_ep_setup()
615 static void ep_add_request(struct pxa_ep *ep, struct pxa27x_request *req) in ep_add_request() argument
619 ep_vdbg(ep, "req:%p, lg=%d, udccsr=0x%03x\n", req, in ep_add_request()
620 req->req.length, udc_ep_readl(ep, UDCCSR)); in ep_add_request()
623 list_add_tail(&req->queue, &ep->queue); in ep_add_request()
624 pio_irq_enable(ep); in ep_add_request()
638 static void ep_del_request(struct pxa_ep *ep, struct pxa27x_request *req) in ep_del_request() argument
642 ep_vdbg(ep, "req:%p, lg=%d, udccsr=0x%03x\n", req, in ep_del_request()
643 req->req.length, udc_ep_readl(ep, UDCCSR)); in ep_del_request()
647 if (!is_ep0(ep) && list_empty(&ep->queue)) in ep_del_request()
648 pio_irq_disable(ep); in ep_del_request()
662 static void req_done(struct pxa_ep *ep, struct pxa27x_request *req, int status, in req_done() argument
667 ep_del_request(ep, req); in req_done()
674 ep_dbg(ep, "complete req %p stat %d len %u/%u\n", in req_done()
679 spin_unlock_irqrestore(&ep->lock, *pflags); in req_done()
684 spin_lock_irqsave(&ep->lock, *pflags); in req_done()
697 static void ep_end_out_req(struct pxa_ep *ep, struct pxa27x_request *req, in ep_end_out_req() argument
700 inc_ep_stats_reqs(ep, !USB_DIR_IN); in ep_end_out_req()
701 req_done(ep, req, 0, pflags); in ep_end_out_req()
715 static void ep0_end_out_req(struct pxa_ep *ep, struct pxa27x_request *req, in ep0_end_out_req() argument
718 set_ep0state(ep->dev, OUT_STATUS_STAGE); in ep0_end_out_req()
719 ep_end_out_req(ep, req, pflags); in ep0_end_out_req()
720 ep0_idle(ep->dev); in ep0_end_out_req()
733 static void ep_end_in_req(struct pxa_ep *ep, struct pxa27x_request *req, in ep_end_in_req() argument
736 inc_ep_stats_reqs(ep, USB_DIR_IN); in ep_end_in_req()
737 req_done(ep, req, 0, pflags); in ep_end_in_req()
751 static void ep0_end_in_req(struct pxa_ep *ep, struct pxa27x_request *req, in ep0_end_in_req() argument
754 set_ep0state(ep->dev, IN_STATUS_STAGE); in ep0_end_in_req()
755 ep_end_in_req(ep, req, pflags); in ep0_end_in_req()
768 static void nuke(struct pxa_ep *ep, int status) in nuke() argument
773 spin_lock_irqsave(&ep->lock, flags); in nuke()
774 while (!list_empty(&ep->queue)) { in nuke()
775 req = list_entry(ep->queue.next, struct pxa27x_request, queue); in nuke()
776 req_done(ep, req, status, &flags); in nuke()
778 spin_unlock_irqrestore(&ep->lock, flags); in nuke()
792 static int read_packet(struct pxa_ep *ep, struct pxa27x_request *req) in read_packet() argument
797 bytes_ep = ep_count_bytes_remain(ep); in read_packet()
803 if (likely(!ep_is_empty(ep))) in read_packet()
809 *buf++ = udc_ep_readl(ep, UDCDR); in read_packet()
812 ep_write_UDCCSR(ep, UDCCSR_PC); in read_packet()
829 static int write_packet(struct pxa_ep *ep, struct pxa27x_request *req, in write_packet() argument
845 udc_ep_writel(ep, UDCDR, *buf++); in write_packet()
849 udc_ep_writeb(ep, UDCDR, *buf_8++); in write_packet()
851 ep_vdbg(ep, "length=%d+%d, udccsr=0x%03x\n", count, remain, in write_packet()
852 udc_ep_readl(ep, UDCCSR)); in write_packet()
871 static int read_fifo(struct pxa_ep *ep, struct pxa27x_request *req) in read_fifo() argument
875 while (epout_has_pkt(ep)) { in read_fifo()
876 count = read_packet(ep, req); in read_fifo()
877 inc_ep_stats_bytes(ep, count, !USB_DIR_IN); in read_fifo()
879 is_short = (count < ep->fifo_size); in read_fifo()
880 ep_dbg(ep, "read udccsr:%03x, count:%d bytes%s req %p %d/%d\n", in read_fifo()
881 udc_ep_readl(ep, UDCCSR), count, is_short ? "/S" : "", in read_fifo()
906 static int write_fifo(struct pxa_ep *ep, struct pxa27x_request *req) in write_fifo() argument
912 max = ep->fifo_size; in write_fifo()
914 udccsr = udc_ep_readl(ep, UDCCSR); in write_fifo()
916 ep_vdbg(ep, "Clearing Transmit Complete, udccsr=%x\n", in write_fifo()
918 ep_write_UDCCSR(ep, UDCCSR_PC); in write_fifo()
921 ep_vdbg(ep, "Clearing Underrun on, udccsr=%x\n", in write_fifo()
923 ep_write_UDCCSR(ep, UDCCSR_TRN); in write_fifo()
926 count = write_packet(ep, req, max); in write_fifo()
927 inc_ep_stats_bytes(ep, count, USB_DIR_IN); in write_fifo()
941 is_short = unlikely(max < ep->fifo_size); in write_fifo()
945 ep_write_UDCCSR(ep, UDCCSR_SP); in write_fifo()
952 } while (!ep_is_full(ep)); in write_fifo()
954 ep_dbg(ep, "wrote count:%d bytes%s%s, left:%d req=%p\n", in write_fifo()
972 static int read_ep0_fifo(struct pxa_ep *ep, struct pxa27x_request *req) in read_ep0_fifo() argument
976 while (epout_has_pkt(ep)) { in read_ep0_fifo()
977 count = read_packet(ep, req); in read_ep0_fifo()
978 ep_write_UDCCSR(ep, UDCCSR0_OPC); in read_ep0_fifo()
979 inc_ep_stats_bytes(ep, count, !USB_DIR_IN); in read_ep0_fifo()
981 is_short = (count < ep->fifo_size); in read_ep0_fifo()
982 ep_dbg(ep, "read udccsr:%03x, count:%d bytes%s req %p %d/%d\n", in read_ep0_fifo()
983 udc_ep_readl(ep, UDCCSR), count, is_short ? "/S" : "", in read_ep0_fifo()
1010 static int write_ep0_fifo(struct pxa_ep *ep, struct pxa27x_request *req) in write_ep0_fifo() argument
1015 count = write_packet(ep, req, EP0_FIFO_SIZE); in write_ep0_fifo()
1016 inc_ep_stats_bytes(ep, count, USB_DIR_IN); in write_ep0_fifo()
1023 ep_write_UDCCSR(ep, UDCCSR0_IPR); in write_ep0_fifo()
1025 ep_dbg(ep, "in %d bytes%s%s, %d left, req=%p, udccsr0=0x%03x\n", in write_ep0_fifo()
1028 &req->req, udc_ep_readl(ep, UDCCSR)); in write_ep0_fifo()
1049 struct pxa_ep *ep; in pxa_ep_queue() local
1067 ep = udc_usb_ep->pxa_ep; in pxa_ep_queue()
1068 if (unlikely(!ep)) in pxa_ep_queue()
1071 dev = ep->dev; in pxa_ep_queue()
1073 ep_dbg(ep, "bogus device state\n"); in pxa_ep_queue()
1080 if (unlikely(EPXFERTYPE_is_ISO(ep) in pxa_ep_queue()
1081 && req->req.length > ep->fifo_size)) in pxa_ep_queue()
1084 spin_lock_irqsave(&ep->lock, flags); in pxa_ep_queue()
1085 recursion_detected = ep->in_handle_ep; in pxa_ep_queue()
1087 is_first_req = list_empty(&ep->queue); in pxa_ep_queue()
1088 ep_dbg(ep, "queue req %p(first=%s), len %d buf %p\n", in pxa_ep_queue()
1092 if (!ep->enabled) { in pxa_ep_queue()
1099 ep_err(ep, "refusing to queue req %p (already queued)\n", req); in pxa_ep_queue()
1107 ep_add_request(ep, req); in pxa_ep_queue()
1108 spin_unlock_irqrestore(&ep->lock, flags); in pxa_ep_queue()
1110 if (is_ep0(ep)) { in pxa_ep_queue()
1114 ep_end_in_req(ep, req, NULL); in pxa_ep_queue()
1116 ep_err(ep, "got a request of %d bytes while" in pxa_ep_queue()
1119 ep_del_request(ep, req); in pxa_ep_queue()
1122 ep0_idle(ep->dev); in pxa_ep_queue()
1125 if (!ep_is_full(ep)) in pxa_ep_queue()
1126 if (write_ep0_fifo(ep, req)) in pxa_ep_queue()
1127 ep0_end_in_req(ep, req, NULL); in pxa_ep_queue()
1130 if ((length == 0) || !epout_has_pkt(ep)) in pxa_ep_queue()
1131 if (read_ep0_fifo(ep, req)) in pxa_ep_queue()
1132 ep0_end_out_req(ep, req, NULL); in pxa_ep_queue()
1135 ep_err(ep, "odd state %s to send me a request\n", in pxa_ep_queue()
1136 EP0_STNAME(ep->dev)); in pxa_ep_queue()
1137 ep_del_request(ep, req); in pxa_ep_queue()
1143 handle_ep(ep); in pxa_ep_queue()
1149 spin_unlock_irqrestore(&ep->lock, flags); in pxa_ep_queue()
1162 struct pxa_ep *ep; in pxa_ep_dequeue() local
1171 ep = udc_usb_ep->pxa_ep; in pxa_ep_dequeue()
1172 if (!ep || is_ep0(ep)) in pxa_ep_dequeue()
1175 spin_lock_irqsave(&ep->lock, flags); in pxa_ep_dequeue()
1178 list_for_each_entry(req, &ep->queue, queue) { in pxa_ep_dequeue()
1185 spin_unlock_irqrestore(&ep->lock, flags); in pxa_ep_dequeue()
1187 req_done(ep, req, -ECONNRESET, NULL); in pxa_ep_dequeue()
1200 struct pxa_ep *ep; in pxa_ep_set_halt() local
1209 ep = udc_usb_ep->pxa_ep; in pxa_ep_set_halt()
1210 if (!ep || is_ep0(ep)) in pxa_ep_set_halt()
1220 ep_dbg(ep, "only host can clear halt\n"); in pxa_ep_set_halt()
1224 spin_lock_irqsave(&ep->lock, flags); in pxa_ep_set_halt()
1227 if (ep->dir_in && (ep_is_full(ep) || !list_empty(&ep->queue))) in pxa_ep_set_halt()
1232 ep_write_UDCCSR(ep, UDCCSR_FST | UDCCSR_FEF); in pxa_ep_set_halt()
1233 if (is_ep0(ep)) in pxa_ep_set_halt()
1234 set_ep0state(ep->dev, STALL); in pxa_ep_set_halt()
1237 spin_unlock_irqrestore(&ep->lock, flags); in pxa_ep_set_halt()
1249 struct pxa_ep *ep; in pxa_ep_fifo_status() local
1255 ep = udc_usb_ep->pxa_ep; in pxa_ep_fifo_status()
1256 if (!ep || is_ep0(ep)) in pxa_ep_fifo_status()
1259 if (ep->dir_in) in pxa_ep_fifo_status()
1261 if (ep->dev->gadget.speed == USB_SPEED_UNKNOWN || ep_is_empty(ep)) in pxa_ep_fifo_status()
1264 return ep_count_bytes_remain(ep) + 1; in pxa_ep_fifo_status()
1275 struct pxa_ep *ep; in pxa_ep_fifo_flush() local
1282 ep = udc_usb_ep->pxa_ep; in pxa_ep_fifo_flush()
1283 if (!ep || is_ep0(ep)) in pxa_ep_fifo_flush()
1286 spin_lock_irqsave(&ep->lock, flags); in pxa_ep_fifo_flush()
1288 if (unlikely(!list_empty(&ep->queue))) in pxa_ep_fifo_flush()
1289 ep_dbg(ep, "called while queue list not empty\n"); in pxa_ep_fifo_flush()
1290 ep_dbg(ep, "called\n"); in pxa_ep_fifo_flush()
1293 if (!ep->dir_in) { in pxa_ep_fifo_flush()
1294 while (!ep_is_empty(ep)) in pxa_ep_fifo_flush()
1295 udc_ep_readl(ep, UDCDR); in pxa_ep_fifo_flush()
1298 ep_write_UDCCSR(ep, in pxa_ep_fifo_flush()
1300 | (EPXFERTYPE_is_ISO(ep) ? 0 : UDCCSR_SST)); in pxa_ep_fifo_flush()
1303 spin_unlock_irqrestore(&ep->lock, flags); in pxa_ep_fifo_flush()
1319 struct pxa_ep *ep; in pxa_ep_enable() local
1328 ep = udc_usb_ep->pxa_ep; in pxa_ep_enable()
1329 ep_warn(ep, "usb_ep %s already enabled, doing nothing\n", in pxa_ep_enable()
1332 ep = find_pxa_ep(udc_usb_ep->dev, udc_usb_ep); in pxa_ep_enable()
1335 if (!ep || is_ep0(ep)) { in pxa_ep_enable()
1343 || (ep->type != usb_endpoint_type(desc))) { in pxa_ep_enable()
1344 ep_err(ep, "type mismatch\n"); in pxa_ep_enable()
1348 if (ep->fifo_size < usb_endpoint_maxp(desc)) { in pxa_ep_enable()
1349 ep_err(ep, "bad maxpacket\n"); in pxa_ep_enable()
1353 udc_usb_ep->pxa_ep = ep; in pxa_ep_enable()
1354 udc = ep->dev; in pxa_ep_enable()
1357 ep_err(ep, "bogus device state\n"); in pxa_ep_enable()
1361 ep->enabled = 1; in pxa_ep_enable()
1366 ep_dbg(ep, "enabled\n"); in pxa_ep_enable()
1380 struct pxa_ep *ep; in pxa_ep_disable() local
1387 ep = udc_usb_ep->pxa_ep; in pxa_ep_disable()
1388 if (!ep || is_ep0(ep) || !list_empty(&ep->queue)) in pxa_ep_disable()
1391 ep->enabled = 0; in pxa_ep_disable()
1392 nuke(ep, -ESHUTDOWN); in pxa_ep_disable()
1397 ep_dbg(ep, "disabled\n"); in pxa_ep_disable()
1660 struct pxa_ep *ep; in udc_init_data() local
1671 ep = &dev->pxa_ep[i]; in udc_init_data()
1673 ep->enabled = is_ep0(ep); in udc_init_data()
1674 INIT_LIST_HEAD(&ep->queue); in udc_init_data()
1675 spin_lock_init(&ep->lock); in udc_init_data()
1818 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0_ctrl_req() local
1827 nuke(ep, -EPROTO); in handle_ep0_ctrl_req()
1828 spin_lock_irqsave(&ep->lock, flags); in handle_ep0_ctrl_req()
1836 if (epout_has_pkt(ep) && (ep_count_bytes_remain(ep) == 0)) in handle_ep0_ctrl_req()
1837 ep_write_UDCCSR(ep, UDCCSR0_OPC); in handle_ep0_ctrl_req()
1841 if (unlikely(ep_is_empty(ep))) in handle_ep0_ctrl_req()
1843 u.word[i] = udc_ep_readl(ep, UDCDR); in handle_ep0_ctrl_req()
1846 have_extrabytes = !ep_is_empty(ep); in handle_ep0_ctrl_req()
1847 while (!ep_is_empty(ep)) { in handle_ep0_ctrl_req()
1848 i = udc_ep_readl(ep, UDCDR); in handle_ep0_ctrl_req()
1849 ep_err(ep, "wrong to have extra bytes for setup : 0x%08x\n", i); in handle_ep0_ctrl_req()
1852 ep_dbg(ep, "SETUP %02x.%02x v%04x i%04x l%04x\n", in handle_ep0_ctrl_req()
1865 ep_write_UDCCSR(ep, UDCCSR0_SA | UDCCSR0_OPC); in handle_ep0_ctrl_req()
1867 spin_unlock_irqrestore(&ep->lock, flags); in handle_ep0_ctrl_req()
1869 spin_lock_irqsave(&ep->lock, flags); in handle_ep0_ctrl_req()
1873 spin_unlock_irqrestore(&ep->lock, flags); in handle_ep0_ctrl_req()
1876 ep_dbg(ep, "protocol STALL, udccsr0=%03x err %d\n", in handle_ep0_ctrl_req()
1877 udc_ep_readl(ep, UDCCSR), i); in handle_ep0_ctrl_req()
1878 ep_write_UDCCSR(ep, UDCCSR0_FST | UDCCSR0_FTF); in handle_ep0_ctrl_req()
1934 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0() local
1938 if (!list_empty(&ep->queue)) in handle_ep0()
1939 req = list_entry(ep->queue.next, struct pxa27x_request, queue); in handle_ep0()
1941 udccsr0 = udc_ep_readl(ep, UDCCSR); in handle_ep0()
1942 ep_dbg(ep, "state=%s, req=%p, udccsr0=0x%03x, udcbcr=%d, irq_msk=%x\n", in handle_ep0()
1943 EP0_STNAME(udc), req, udccsr0, udc_ep_readl(ep, UDCBCR), in handle_ep0()
1947 ep_dbg(ep, "clearing stall status\n"); in handle_ep0()
1948 nuke(ep, -EPIPE); in handle_ep0()
1949 ep_write_UDCCSR(ep, UDCCSR0_SST); in handle_ep0()
1954 nuke(ep, 0); in handle_ep0()
1973 if (epout_has_pkt(ep)) in handle_ep0()
1974 ep_write_UDCCSR(ep, UDCCSR0_OPC); in handle_ep0()
1975 if (req && !ep_is_full(ep)) in handle_ep0()
1976 completed = write_ep0_fifo(ep, req); in handle_ep0()
1978 ep0_end_in_req(ep, req, NULL); in handle_ep0()
1981 if (epout_has_pkt(ep) && req) in handle_ep0()
1982 completed = read_ep0_fifo(ep, req); in handle_ep0()
1984 ep0_end_out_req(ep, req, NULL); in handle_ep0()
1987 ep_write_UDCCSR(ep, UDCCSR0_FST); in handle_ep0()
2000 ep_warn(ep, "should never get in %s state here!!!\n", in handle_ep0()
2001 EP0_STNAME(ep->dev)); in handle_ep0()
2016 static void handle_ep(struct pxa_ep *ep) in handle_ep() argument
2021 int is_in = ep->dir_in; in handle_ep()
2025 spin_lock_irqsave(&ep->lock, flags); in handle_ep()
2026 if (ep->in_handle_ep) in handle_ep()
2028 ep->in_handle_ep = 1; in handle_ep()
2032 udccsr = udc_ep_readl(ep, UDCCSR); in handle_ep()
2034 if (likely(!list_empty(&ep->queue))) in handle_ep()
2035 req = list_entry(ep->queue.next, in handle_ep()
2040 ep_dbg(ep, "req:%p, udccsr 0x%03x loop=%d\n", in handle_ep()
2044 udc_ep_writel(ep, UDCCSR, in handle_ep()
2050 if (likely(!ep_is_full(ep))) in handle_ep()
2051 completed = write_fifo(ep, req); in handle_ep()
2053 if (likely(epout_has_pkt(ep))) in handle_ep()
2054 completed = read_fifo(ep, req); in handle_ep()
2059 ep_end_in_req(ep, req, &flags); in handle_ep()
2061 ep_end_out_req(ep, req, &flags); in handle_ep()
2065 ep->in_handle_ep = 0; in handle_ep()
2067 spin_unlock_irqrestore(&ep->lock, flags); in handle_ep()
2138 struct pxa_ep *ep; in irq_handle_data() local
2158 ep = &udc->pxa_ep[i]; in irq_handle_data()
2159 ep->stats.irqs++; in irq_handle_data()
2160 handle_ep(ep); in irq_handle_data()
2171 ep = &udc->pxa_ep[i]; in irq_handle_data()
2172 ep->stats.irqs++; in irq_handle_data()
2173 handle_ep(ep); in irq_handle_data()
2240 struct pxa_ep *ep = &udc->pxa_ep[0]; in irq_udc_reset() local
2253 nuke(ep, -EPROTO); in irq_udc_reset()
2254 ep_write_UDCCSR(ep, UDCCSR0_FTF | UDCCSR0_OPC); in irq_udc_reset()
2493 struct pxa_ep *ep; in pxa_udc_suspend() local
2495 ep = &udc->pxa_ep[0]; in pxa_udc_suspend()
2496 udc->udccsr0 = udc_ep_readl(ep, UDCCSR); in pxa_udc_suspend()
2518 struct pxa_ep *ep; in pxa_udc_resume() local
2520 ep = &udc->pxa_ep[0]; in pxa_udc_resume()
2521 udc_ep_writel(ep, UDCCSR, udc->udccsr0 & (UDCCSR0_FST | UDCCSR0_DME)); in pxa_udc_resume()