Lines Matching full:hs_ep

129  * @hs_ep: The endpoint
134 static inline void dwc2_gadget_incr_frame_num(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_incr_frame_num() argument
136 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_incr_frame_num()
143 hs_ep->target_frame += hs_ep->interval; in dwc2_gadget_incr_frame_num()
144 if (hs_ep->target_frame > limit) { in dwc2_gadget_incr_frame_num()
145 hs_ep->frame_overrun = true; in dwc2_gadget_incr_frame_num()
146 hs_ep->target_frame &= limit; in dwc2_gadget_incr_frame_num()
147 } else if (current_frame <= hs_ep->target_frame) { in dwc2_gadget_incr_frame_num()
148 hs_ep->frame_overrun = false; in dwc2_gadget_incr_frame_num()
155 * @hs_ep: The endpoint.
162 static inline void dwc2_gadget_dec_frame_num_by_one(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_dec_frame_num_by_one() argument
164 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_dec_frame_num_by_one()
170 if (hs_ep->target_frame) in dwc2_gadget_dec_frame_num_by_one()
171 hs_ep->target_frame -= 1; in dwc2_gadget_dec_frame_num_by_one()
173 hs_ep->target_frame = limit; in dwc2_gadget_dec_frame_num_by_one()
431 * @hs_ep: The endpoint to query.
436 static inline int is_ep_periodic(struct dwc2_hsotg_ep *hs_ep) in is_ep_periodic() argument
438 return hs_ep->periodic; in is_ep_periodic()
444 * @hs_ep: The endpoint for the request
451 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_unmap_dma() argument
456 usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->map_dir); in dwc2_hsotg_unmap_dma()
510 * @hs_ep: The endpoint we're going to write for.
524 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_write_fifo() argument
527 bool periodic = is_ep_periodic(hs_ep); in dwc2_hsotg_write_fifo()
530 int to_write = hs_ep->size_loaded; in dwc2_hsotg_write_fifo()
536 to_write -= (buf_pos - hs_ep->last_load); in dwc2_hsotg_write_fifo()
543 u32 epsize = dwc2_readl(hsotg, DIEPTSIZ(hs_ep->index)); in dwc2_hsotg_write_fifo()
558 if (hs_ep->fifo_load != 0) { in dwc2_hsotg_write_fifo()
565 hs_ep->size_loaded, hs_ep->fifo_load, hs_ep->fifo_size); in dwc2_hsotg_write_fifo()
568 size_done = hs_ep->size_loaded - size_left; in dwc2_hsotg_write_fifo()
571 can_write = hs_ep->fifo_load - size_done; in dwc2_hsotg_write_fifo()
575 can_write = hs_ep->fifo_size - can_write; in dwc2_hsotg_write_fifo()
583 } else if (hsotg->dedicated_fifos && hs_ep->index != 0) { in dwc2_hsotg_write_fifo()
585 DTXFSTS(hs_ep->fifo_index)); in dwc2_hsotg_write_fifo()
603 max_transfer = hs_ep->ep.maxpacket * hs_ep->mc; in dwc2_hsotg_write_fifo()
667 hs_ep->total_data += to_write; in dwc2_hsotg_write_fifo()
670 hs_ep->fifo_load += to_write; in dwc2_hsotg_write_fifo()
675 dwc2_writel_rep(hsotg, EPFIFO(hs_ep->index), data, to_write); in dwc2_hsotg_write_fifo()
682 * @hs_ep: The endpoint
687 static unsigned int get_ep_limit(struct dwc2_hsotg_ep *hs_ep) in get_ep_limit() argument
689 int index = hs_ep->index; in get_ep_limit()
698 if (hs_ep->dir_in) in get_ep_limit()
713 if ((maxpkt * hs_ep->ep.maxpacket) < maxsize) in get_ep_limit()
714 maxsize = maxpkt * hs_ep->ep.maxpacket; in get_ep_limit()
722 * @hs_ep: The endpoint
728 static unsigned int dwc2_gadget_get_chain_limit(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_get_chain_limit() argument
730 const struct usb_endpoint_descriptor *ep_desc = hs_ep->ep.desc; in dwc2_gadget_get_chain_limit()
731 int is_isoc = hs_ep->isochronous; in dwc2_gadget_get_chain_limit()
733 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_get_chain_limit()
734 int dir_in = hs_ep->dir_in; in dwc2_gadget_get_chain_limit()
737 maxsize = (hs_ep->dir_in ? DEV_DMA_ISOC_TX_NBYTES_LIMIT : in dwc2_gadget_get_chain_limit()
744 if (hs_ep->index) in dwc2_gadget_get_chain_limit()
753 * @hs_ep: The endpoint
768 static u32 dwc2_gadget_get_desc_params(struct dwc2_hsotg_ep *hs_ep, u32 *mask) in dwc2_gadget_get_desc_params() argument
770 const struct usb_endpoint_descriptor *ep_desc = hs_ep->ep.desc; in dwc2_gadget_get_desc_params()
771 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_get_desc_params()
772 int dir_in = hs_ep->dir_in; in dwc2_gadget_get_desc_params()
775 if (!hs_ep->index && !dir_in) { in dwc2_gadget_get_desc_params()
778 } else if (hs_ep->isochronous) { in dwc2_gadget_get_desc_params()
795 if (hs_ep->index) in dwc2_gadget_get_desc_params()
804 static void dwc2_gadget_fill_nonisoc_xfer_ddma_one(struct dwc2_hsotg_ep *hs_ep, in dwc2_gadget_fill_nonisoc_xfer_ddma_one() argument
810 int dir_in = hs_ep->dir_in; in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
811 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
817 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
819 hs_ep->desc_count = (len / maxsize) + in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
822 hs_ep->desc_count = 1; in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
824 for (i = 0; i < hs_ep->desc_count; ++i) { in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
830 if (!hs_ep->index && !dir_in) in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
845 ((hs_ep->send_zlp && true_last) ? in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
862 * @hs_ep: The endpoint
870 static void dwc2_gadget_config_nonisoc_xfer_ddma(struct dwc2_hsotg_ep *hs_ep, in dwc2_gadget_config_nonisoc_xfer_ddma() argument
875 struct dwc2_dma_desc *desc = hs_ep->desc_list; in dwc2_gadget_config_nonisoc_xfer_ddma()
880 if (hs_ep->req) in dwc2_gadget_config_nonisoc_xfer_ddma()
881 ureq = &hs_ep->req->req; in dwc2_gadget_config_nonisoc_xfer_ddma()
885 dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, in dwc2_gadget_config_nonisoc_xfer_ddma()
892 dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, in dwc2_gadget_config_nonisoc_xfer_ddma()
895 desc_count += hs_ep->desc_count; in dwc2_gadget_config_nonisoc_xfer_ddma()
898 hs_ep->desc_count = desc_count; in dwc2_gadget_config_nonisoc_xfer_ddma()
903 * @hs_ep: The isochronous endpoint.
912 static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, in dwc2_gadget_fill_isoc_desc() argument
916 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_fill_isoc_desc()
921 dwc2_gadget_get_desc_params(hs_ep, &mask); in dwc2_gadget_fill_isoc_desc()
923 index = hs_ep->next_desc; in dwc2_gadget_fill_isoc_desc()
924 desc = &hs_ep->desc_list[index]; in dwc2_gadget_fill_isoc_desc()
934 if (hs_ep->next_desc) in dwc2_gadget_fill_isoc_desc()
935 hs_ep->desc_list[index - 1].status &= ~DEV_DMA_L; in dwc2_gadget_fill_isoc_desc()
938 __func__, hs_ep->index, hs_ep->dir_in ? "in" : "out", index); in dwc2_gadget_fill_isoc_desc()
947 if (hs_ep->dir_in) { in dwc2_gadget_fill_isoc_desc()
949 pid = DIV_ROUND_UP(len, hs_ep->ep.maxpacket); in dwc2_gadget_fill_isoc_desc()
954 ((len % hs_ep->ep.maxpacket) ? in dwc2_gadget_fill_isoc_desc()
956 ((hs_ep->target_frame << in dwc2_gadget_fill_isoc_desc()
965 if (hs_ep->dir_in) in dwc2_gadget_fill_isoc_desc()
966 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_fill_isoc_desc()
969 hs_ep->next_desc++; in dwc2_gadget_fill_isoc_desc()
970 if (hs_ep->next_desc >= MAX_DMA_DESC_NUM_HS_ISOC) in dwc2_gadget_fill_isoc_desc()
971 hs_ep->next_desc = 0; in dwc2_gadget_fill_isoc_desc()
978 * @hs_ep: The isochronous endpoint.
983 static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_start_isoc_ddma() argument
985 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_start_isoc_ddma()
987 int index = hs_ep->index; in dwc2_gadget_start_isoc_ddma()
995 if (list_empty(&hs_ep->queue)) { in dwc2_gadget_start_isoc_ddma()
996 hs_ep->target_frame = TARGET_FRAME_INITIAL; in dwc2_gadget_start_isoc_ddma()
1003 desc = &hs_ep->desc_list[i]; in dwc2_gadget_start_isoc_ddma()
1009 hs_ep->next_desc = 0; in dwc2_gadget_start_isoc_ddma()
1010 list_for_each_entry_safe(hs_req, treq, &hs_ep->queue, queue) { in dwc2_gadget_start_isoc_ddma()
1017 ret = dwc2_gadget_fill_isoc_desc(hs_ep, dma_addr, in dwc2_gadget_start_isoc_ddma()
1023 hs_ep->compl_desc = 0; in dwc2_gadget_start_isoc_ddma()
1024 depctl = hs_ep->dir_in ? DIEPCTL(index) : DOEPCTL(index); in dwc2_gadget_start_isoc_ddma()
1025 dma_reg = hs_ep->dir_in ? DIEPDMA(index) : DOEPDMA(index); in dwc2_gadget_start_isoc_ddma()
1028 dwc2_writel(hsotg, hs_ep->desc_list_dma, dma_reg); in dwc2_gadget_start_isoc_ddma()
1035 static bool dwc2_gadget_target_frame_elapsed(struct dwc2_hsotg_ep *hs_ep);
1037 struct dwc2_hsotg_ep *hs_ep,
1044 * @hs_ep: The endpoint to process a request for
1052 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_start_req() argument
1057 int index = hs_ep->index; in dwc2_hsotg_start_req()
1058 int dir_in = hs_ep->dir_in; in dwc2_hsotg_start_req()
1069 if (hs_ep->req && !continuing) { in dwc2_hsotg_start_req()
1073 } else if (hs_ep->req != hs_req && continuing) { in dwc2_hsotg_start_req()
1087 hs_ep->dir_in ? "in" : "out"); in dwc2_hsotg_start_req()
1102 maxreq = get_ep_limit(hs_ep); in dwc2_hsotg_start_req()
1104 maxreq = dwc2_gadget_get_chain_limit(hs_ep); in dwc2_hsotg_start_req()
1107 int round = maxreq % hs_ep->ep.maxpacket; in dwc2_hsotg_start_req()
1120 packets = DIV_ROUND_UP(length, hs_ep->ep.maxpacket); in dwc2_hsotg_start_req()
1125 if (hs_ep->isochronous) in dwc2_hsotg_start_req()
1138 if ((ureq->length >= hs_ep->ep.maxpacket) && in dwc2_hsotg_start_req()
1139 !(ureq->length % hs_ep->ep.maxpacket)) in dwc2_hsotg_start_req()
1140 hs_ep->send_zlp = 1; in dwc2_hsotg_start_req()
1150 hs_ep->req = hs_req; in dwc2_hsotg_start_req()
1154 u32 mps = hs_ep->ep.maxpacket; in dwc2_hsotg_start_req()
1168 dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, ureq->dma + offset, in dwc2_hsotg_start_req()
1172 dwc2_writel(hsotg, hs_ep->desc_list_dma, dma_reg); in dwc2_hsotg_start_req()
1175 __func__, (u32)hs_ep->desc_list_dma, dma_reg); in dwc2_hsotg_start_req()
1193 if (hs_ep->isochronous) { in dwc2_hsotg_start_req()
1194 if (!dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_hsotg_start_req()
1195 if (hs_ep->interval == 1) { in dwc2_hsotg_start_req()
1196 if (hs_ep->target_frame & 0x1) in dwc2_hsotg_start_req()
1203 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_hsotg_start_req()
1205 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, -ENODATA); in dwc2_hsotg_start_req()
1226 hs_ep->size_loaded = length; in dwc2_hsotg_start_req()
1227 hs_ep->last_load = ureq->actual; in dwc2_hsotg_start_req()
1231 hs_ep->fifo_load = 0; in dwc2_hsotg_start_req()
1233 dwc2_hsotg_write_fifo(hsotg, hs_ep, hs_req); in dwc2_hsotg_start_req()
1251 dwc2_hsotg_ctrl_epint(hsotg, hs_ep->index, hs_ep->dir_in, 1); in dwc2_hsotg_start_req()
1257 * @hs_ep: The endpoint the request is on.
1267 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_map_dma() argument
1272 hs_ep->map_dir = hs_ep->dir_in; in dwc2_hsotg_map_dma()
1273 ret = usb_gadget_map_request(&hsotg->gadget, req, hs_ep->dir_in); in dwc2_hsotg_map_dma()
1287 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_handle_unaligned_buf_start() argument
1299 hs_ep->ep.name, req_buf, hs_req->req.length); in dwc2_hsotg_handle_unaligned_buf_start()
1313 if (hs_ep->dir_in) in dwc2_hsotg_handle_unaligned_buf_start()
1320 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_handle_unaligned_buf_complete() argument
1328 hs_ep->ep.name, hs_req->req.status, hs_req->req.actual); in dwc2_hsotg_handle_unaligned_buf_complete()
1331 if (!hs_ep->dir_in && !hs_req->req.status) in dwc2_hsotg_handle_unaligned_buf_complete()
1344 * @hs_ep: The driver endpoint to check
1349 static bool dwc2_gadget_target_frame_elapsed(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_target_frame_elapsed() argument
1351 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_target_frame_elapsed()
1352 u32 target_frame = hs_ep->target_frame; in dwc2_gadget_target_frame_elapsed()
1354 bool frame_overrun = hs_ep->frame_overrun; in dwc2_gadget_target_frame_elapsed()
1373 * @hs_ep: the ep descriptor chain is for
1379 struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_set_ep0_desc_chain() argument
1384 hs_ep->desc_list = hsotg->setup_desc[0]; in dwc2_gadget_set_ep0_desc_chain()
1385 hs_ep->desc_list_dma = hsotg->setup_desc_dma[0]; in dwc2_gadget_set_ep0_desc_chain()
1389 hs_ep->desc_list = hsotg->ctrl_in_desc; in dwc2_gadget_set_ep0_desc_chain()
1390 hs_ep->desc_list_dma = hsotg->ctrl_in_desc_dma; in dwc2_gadget_set_ep0_desc_chain()
1393 hs_ep->desc_list = hsotg->ctrl_out_desc; in dwc2_gadget_set_ep0_desc_chain()
1394 hs_ep->desc_list_dma = hsotg->ctrl_out_desc_dma; in dwc2_gadget_set_ep0_desc_chain()
1405 static void dwc2_gadget_start_next_request(struct dwc2_hsotg_ep *hs_ep);
1411 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_queue() local
1412 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_queue()
1436 if (hs_ep->isochronous && in dwc2_hsotg_ep_queue()
1437 req->length > (hs_ep->mc * hs_ep->ep.maxpacket)) { in dwc2_hsotg_ep_queue()
1445 if (using_desc_dma(hs) && hs_ep->isochronous) { in dwc2_hsotg_ep_queue()
1446 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); in dwc2_hsotg_ep_queue()
1447 if (hs_ep->dir_in && req->length > maxsize) { in dwc2_hsotg_ep_queue()
1453 if (!hs_ep->dir_in && req->length > hs_ep->ep.maxpacket) { in dwc2_hsotg_ep_queue()
1455 req->length, hs_ep->ep.maxpacket); in dwc2_hsotg_ep_queue()
1460 ret = dwc2_hsotg_handle_unaligned_buf_start(hs, hs_ep, hs_req); in dwc2_hsotg_ep_queue()
1466 ret = dwc2_hsotg_map_dma(hs, hs_ep, req); in dwc2_hsotg_ep_queue()
1471 if (using_desc_dma(hs) && !hs_ep->index) { in dwc2_hsotg_ep_queue()
1472 ret = dwc2_gadget_set_ep0_desc_chain(hs, hs_ep); in dwc2_hsotg_ep_queue()
1477 first = list_empty(&hs_ep->queue); in dwc2_hsotg_ep_queue()
1478 list_add_tail(&hs_req->queue, &hs_ep->queue); in dwc2_hsotg_ep_queue()
1486 if (using_desc_dma(hs) && hs_ep->isochronous) { in dwc2_hsotg_ep_queue()
1487 if (hs_ep->target_frame != TARGET_FRAME_INITIAL) { in dwc2_hsotg_ep_queue()
1494 dwc2_gadget_fill_isoc_desc(hs_ep, dma_addr, in dwc2_hsotg_ep_queue()
1501 if (!hs_ep->index && !req->length && !hs_ep->dir_in && in dwc2_hsotg_ep_queue()
1503 hs_ep->dir_in = 1; in dwc2_hsotg_ep_queue()
1506 if (!hs_ep->isochronous) { in dwc2_hsotg_ep_queue()
1507 dwc2_hsotg_start_req(hs, hs_ep, hs_req, false); in dwc2_hsotg_ep_queue()
1513 while (dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_hsotg_ep_queue()
1514 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_ep_queue()
1521 if (hs_ep->target_frame != TARGET_FRAME_INITIAL) in dwc2_hsotg_ep_queue()
1522 dwc2_hsotg_start_req(hs, hs_ep, hs_req, false); in dwc2_hsotg_ep_queue()
1523 } else if (hs_ep->isochronous && hs_ep->dir_in && !hs_ep->req && in dwc2_hsotg_ep_queue()
1527 while (dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_hsotg_ep_queue()
1528 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_ep_queue()
1535 if (hs_ep->target_frame != TARGET_FRAME_INITIAL) in dwc2_hsotg_ep_queue()
1536 dwc2_gadget_start_next_request(hs_ep); in dwc2_hsotg_ep_queue()
1544 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_queue_lock() local
1545 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_queue_lock()
1575 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_complete_oursetup() local
1576 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_complete_oursetup()
1743 * @hs_ep: The controller endpoint to get
1747 static struct dwc2_hsotg_req *get_ep_head(struct dwc2_hsotg_ep *hs_ep) in get_ep_head() argument
1749 return list_first_entry_or_null(&hs_ep->queue, struct dwc2_hsotg_req, in get_ep_head()
1755 * @hs_ep: Endpoint structure
1761 static void dwc2_gadget_start_next_request(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_start_next_request() argument
1763 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_start_next_request()
1764 int dir_in = hs_ep->dir_in; in dwc2_gadget_start_next_request()
1767 if (!list_empty(&hs_ep->queue)) { in dwc2_gadget_start_next_request()
1768 hs_req = get_ep_head(hs_ep); in dwc2_gadget_start_next_request()
1769 dwc2_hsotg_start_req(hsotg, hs_ep, hs_req, false); in dwc2_gadget_start_next_request()
1772 if (!hs_ep->isochronous) in dwc2_gadget_start_next_request()
2029 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_complete_setup() local
2030 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_complete_setup()
2085 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_program_zlp() argument
2088 u8 index = hs_ep->index; in dwc2_hsotg_program_zlp()
2089 u32 epctl_reg = hs_ep->dir_in ? DIEPCTL(index) : DOEPCTL(index); in dwc2_hsotg_program_zlp()
2090 u32 epsiz_reg = hs_ep->dir_in ? DIEPTSIZ(index) : DOEPTSIZ(index); in dwc2_hsotg_program_zlp()
2092 if (hs_ep->dir_in) in dwc2_hsotg_program_zlp()
2100 dma_addr_t dma = hs_ep->desc_list_dma; in dwc2_hsotg_program_zlp()
2103 dwc2_gadget_set_ep0_desc_chain(hsotg, hs_ep); in dwc2_hsotg_program_zlp()
2105 dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, dma, 0); in dwc2_hsotg_program_zlp()
2122 * @hs_ep: The endpoint the request was on.
2133 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_complete_request() argument
2143 hs_ep, hs_ep->ep.name, hs_req, result, hs_req->req.complete); in dwc2_hsotg_complete_request()
2154 dwc2_hsotg_unmap_dma(hsotg, hs_ep, hs_req); in dwc2_hsotg_complete_request()
2156 dwc2_hsotg_handle_unaligned_buf_complete(hsotg, hs_ep, hs_req); in dwc2_hsotg_complete_request()
2158 hs_ep->req = NULL; in dwc2_hsotg_complete_request()
2168 usb_gadget_giveback_request(&hs_ep->ep, &hs_req->req); in dwc2_hsotg_complete_request()
2173 if (using_desc_dma(hsotg) && hs_ep->isochronous) in dwc2_hsotg_complete_request()
2182 if (!hs_ep->req && result >= 0) in dwc2_hsotg_complete_request()
2183 dwc2_gadget_start_next_request(hs_ep); in dwc2_hsotg_complete_request()
2188 * @hs_ep: The endpoint the request was on.
2195 static void dwc2_gadget_complete_isoc_request_ddma(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_complete_isoc_request_ddma() argument
2197 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_complete_isoc_request_ddma()
2203 desc_sts = hs_ep->desc_list[hs_ep->compl_desc].status; in dwc2_gadget_complete_isoc_request_ddma()
2209 hs_req = get_ep_head(hs_ep); in dwc2_gadget_complete_isoc_request_ddma()
2219 mask = hs_ep->dir_in ? DEV_DMA_ISOC_TX_NBYTES_MASK : in dwc2_gadget_complete_isoc_request_ddma()
2227 if (!hs_ep->dir_in && ureq->length & 0x3) in dwc2_gadget_complete_isoc_request_ddma()
2236 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_gadget_complete_isoc_request_ddma()
2238 hs_ep->compl_desc++; in dwc2_gadget_complete_isoc_request_ddma()
2239 if (hs_ep->compl_desc > (MAX_DMA_DESC_NUM_HS_ISOC - 1)) in dwc2_gadget_complete_isoc_request_ddma()
2240 hs_ep->compl_desc = 0; in dwc2_gadget_complete_isoc_request_ddma()
2241 desc_sts = hs_ep->desc_list[hs_ep->compl_desc].status; in dwc2_gadget_complete_isoc_request_ddma()
2247 * @hs_ep: The isochronous endpoint.
2254 static void dwc2_gadget_handle_isoc_bna(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_handle_isoc_bna() argument
2256 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_handle_isoc_bna()
2258 if (!hs_ep->dir_in) in dwc2_gadget_handle_isoc_bna()
2260 dwc2_hsotg_complete_request(hsotg, hs_ep, get_ep_head(hs_ep), 0); in dwc2_gadget_handle_isoc_bna()
2262 hs_ep->target_frame = TARGET_FRAME_INITIAL; in dwc2_gadget_handle_isoc_bna()
2263 hs_ep->next_desc = 0; in dwc2_gadget_handle_isoc_bna()
2264 hs_ep->compl_desc = 0; in dwc2_gadget_handle_isoc_bna()
2279 struct dwc2_hsotg_ep *hs_ep = hsotg->eps_out[ep_idx]; in dwc2_hsotg_rx_data() local
2280 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_rx_data()
2317 hs_ep->total_data += to_read; in dwc2_hsotg_rx_data()
2352 * @hs_ep - The endpoint on which transfer went
2357 static unsigned int dwc2_gadget_get_xfersize_ddma(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_get_xfersize_ddma() argument
2359 const struct usb_endpoint_descriptor *ep_desc = hs_ep->ep.desc; in dwc2_gadget_get_xfersize_ddma()
2360 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_get_xfersize_ddma()
2363 struct dwc2_dma_desc *desc = hs_ep->desc_list; in dwc2_gadget_get_xfersize_ddma()
2366 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_get_xfersize_ddma()
2367 int dir_in = hs_ep->dir_in; in dwc2_gadget_get_xfersize_ddma()
2373 if (hs_ep->index) in dwc2_gadget_get_xfersize_ddma()
2377 for (i = 0; i < hs_ep->desc_count; ++i) { in dwc2_gadget_get_xfersize_ddma()
2407 struct dwc2_hsotg_ep *hs_ep = hsotg->eps_out[epnum]; in dwc2_hsotg_handle_outdone() local
2408 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_handle_outdone()
2420 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_hsotg_handle_outdone()
2426 size_left = dwc2_gadget_get_xfersize_ddma(hs_ep); in dwc2_hsotg_handle_outdone()
2440 size_done = hs_ep->size_loaded - size_left; in dwc2_hsotg_handle_outdone()
2441 size_done += hs_ep->last_load; in dwc2_hsotg_handle_outdone()
2448 dwc2_hsotg_start_req(hsotg, hs_ep, hs_req, true); in dwc2_hsotg_handle_outdone()
2471 if (!using_desc_dma(hsotg) && hs_ep->isochronous) { in dwc2_hsotg_handle_outdone()
2472 req->frame_number = hs_ep->target_frame; in dwc2_hsotg_handle_outdone()
2473 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_handle_outdone()
2476 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, result); in dwc2_hsotg_handle_outdone()
2599 struct dwc2_hsotg_ep *hs_ep; in dwc2_hsotg_set_ep_maxpacket() local
2602 hs_ep = index_to_ep(hsotg, ep, dir_in); in dwc2_hsotg_set_ep_maxpacket()
2603 if (!hs_ep) in dwc2_hsotg_set_ep_maxpacket()
2613 hs_ep->ep.maxpacket = mps_bytes; in dwc2_hsotg_set_ep_maxpacket()
2614 hs_ep->mc = 1; in dwc2_hsotg_set_ep_maxpacket()
2618 hs_ep->mc = mc; in dwc2_hsotg_set_ep_maxpacket()
2621 hs_ep->ep.maxpacket = mps; in dwc2_hsotg_set_ep_maxpacket()
2661 * @hs_ep: The driver endpoint to check.
2667 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_trytx() argument
2669 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_trytx()
2671 if (!hs_ep->dir_in || !hs_req) { in dwc2_hsotg_trytx()
2676 if (hs_ep->index != 0) in dwc2_hsotg_trytx()
2677 dwc2_hsotg_ctrl_epint(hsotg, hs_ep->index, in dwc2_hsotg_trytx()
2678 hs_ep->dir_in, 0); in dwc2_hsotg_trytx()
2684 hs_ep->index); in dwc2_hsotg_trytx()
2685 return dwc2_hsotg_write_fifo(hsotg, hs_ep, hs_req); in dwc2_hsotg_trytx()
2694 * @hs_ep: The endpoint that has just completed.
2700 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_complete_in() argument
2702 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_complete_in()
2703 u32 epsize = dwc2_readl(hsotg, DIEPTSIZ(hs_ep->index)); in dwc2_hsotg_complete_in()
2712 if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_STATUS_IN) { in dwc2_hsotg_complete_in()
2719 hs_ep->dir_in = 0; in dwc2_hsotg_complete_in()
2721 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_hsotg_complete_in()
2747 size_left = dwc2_gadget_get_xfersize_ddma(hs_ep); in dwc2_hsotg_complete_in()
2755 size_done = hs_ep->size_loaded - size_left; in dwc2_hsotg_complete_in()
2756 size_done += hs_ep->last_load; in dwc2_hsotg_complete_in()
2768 dwc2_hsotg_start_req(hsotg, hs_ep, hs_req, true); in dwc2_hsotg_complete_in()
2773 if (hs_ep->send_zlp) { in dwc2_hsotg_complete_in()
2774 hs_ep->send_zlp = 0; in dwc2_hsotg_complete_in()
2776 dwc2_hsotg_program_zlp(hsotg, hs_ep); in dwc2_hsotg_complete_in()
2782 if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_DATA_IN) { in dwc2_hsotg_complete_in()
2789 if (!using_desc_dma(hsotg) && hs_ep->isochronous) { in dwc2_hsotg_complete_in()
2790 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_hsotg_complete_in()
2791 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_complete_in()
2794 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_hsotg_complete_in()
2827 * @hs_ep: The endpoint on which interrupt is asserted.
2838 static void dwc2_gadget_handle_ep_disabled(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_handle_ep_disabled() argument
2840 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_handle_ep_disabled()
2842 unsigned char idx = hs_ep->index; in dwc2_gadget_handle_ep_disabled()
2843 int dir_in = hs_ep->dir_in; in dwc2_gadget_handle_ep_disabled()
2852 dwc2_hsotg_txfifo_flush(hsotg, hs_ep->fifo_index); in dwc2_gadget_handle_ep_disabled()
2868 if (!hs_ep->isochronous) in dwc2_gadget_handle_ep_disabled()
2871 if (list_empty(&hs_ep->queue)) { in dwc2_gadget_handle_ep_disabled()
2873 __func__, hs_ep); in dwc2_gadget_handle_ep_disabled()
2878 hs_req = get_ep_head(hs_ep); in dwc2_gadget_handle_ep_disabled()
2880 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_gadget_handle_ep_disabled()
2882 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, in dwc2_gadget_handle_ep_disabled()
2885 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_ep_disabled()
2888 } while (dwc2_gadget_target_frame_elapsed(hs_ep)); in dwc2_gadget_handle_ep_disabled()
2954 struct dwc2_hsotg_ep *hs_ep);
2958 * @hs_ep: The endpoint on which interrupt is asserted.
2970 static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_handle_nak() argument
2972 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_handle_nak()
2974 int dir_in = hs_ep->dir_in; in dwc2_gadget_handle_nak()
2977 if (!dir_in || !hs_ep->isochronous) in dwc2_gadget_handle_nak()
2980 if (hs_ep->target_frame == TARGET_FRAME_INITIAL) { in dwc2_gadget_handle_nak()
2983 hs_ep->target_frame = hsotg->frame_number; in dwc2_gadget_handle_nak()
2984 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_nak()
2993 hs_ep->target_frame &= ~hs_ep->interval + 1; in dwc2_gadget_handle_nak()
2998 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_nak()
2999 dwc2_gadget_dec_frame_num_by_one(hs_ep); in dwc2_gadget_handle_nak()
3002 dwc2_gadget_start_isoc_ddma(hs_ep); in dwc2_gadget_handle_nak()
3006 hs_ep->target_frame = hsotg->frame_number; in dwc2_gadget_handle_nak()
3007 if (hs_ep->interval > 1) { in dwc2_gadget_handle_nak()
3026 DIEPCTL(hs_ep->index)); in dwc2_gadget_handle_nak()
3027 if (hs_ep->target_frame & 0x1) in dwc2_gadget_handle_nak()
3032 dwc2_writel(hsotg, ctrl, DIEPCTL(hs_ep->index)); in dwc2_gadget_handle_nak()
3039 ctrl = dwc2_readl(hsotg, DIEPCTL(hs_ep->index)); in dwc2_gadget_handle_nak()
3041 dwc2_hsotg_ep_stop_xfr(hsotg, hs_ep); in dwc2_gadget_handle_nak()
3043 dwc2_hsotg_txfifo_flush(hsotg, hs_ep->fifo_index); in dwc2_gadget_handle_nak()
3045 while (dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_gadget_handle_nak()
3046 hs_req = get_ep_head(hs_ep); in dwc2_gadget_handle_nak()
3048 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_gadget_handle_nak()
3050 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, -ENODATA); in dwc2_gadget_handle_nak()
3053 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_nak()
3058 if (!hs_ep->req) in dwc2_gadget_handle_nak()
3059 dwc2_gadget_start_next_request(hs_ep); in dwc2_gadget_handle_nak()
3073 struct dwc2_hsotg_ep *hs_ep = index_to_ep(hsotg, idx, dir_in); in dwc2_hsotg_epint() local
3084 if (!hs_ep) { in dwc2_hsotg_epint()
3103 if (using_desc_dma(hsotg) && idx == 0 && !hs_ep->dir_in && in dwc2_hsotg_epint()
3114 if (using_desc_dma(hsotg) && hs_ep->isochronous) { in dwc2_hsotg_epint()
3115 dwc2_gadget_complete_isoc_request_ddma(hs_ep); in dwc2_hsotg_epint()
3122 if (!hs_ep->isochronous || !(ints & DXEPINT_NAKINTRPT)) in dwc2_hsotg_epint()
3123 dwc2_hsotg_complete_in(hsotg, hs_ep); in dwc2_hsotg_epint()
3125 if (idx == 0 && !hs_ep->req) in dwc2_hsotg_epint()
3132 if (!hs_ep->isochronous || !(ints & DXEPINT_OUTTKNEPDIS)) in dwc2_hsotg_epint()
3138 dwc2_gadget_handle_ep_disabled(hs_ep); in dwc2_hsotg_epint()
3141 dwc2_gadget_handle_out_token_ep_disabled(hs_ep); in dwc2_hsotg_epint()
3144 dwc2_gadget_handle_nak(hs_ep); in dwc2_hsotg_epint()
3196 if (hs_ep->isochronous) in dwc2_hsotg_epint()
3197 dwc2_gadget_handle_isoc_bna(hs_ep); in dwc2_hsotg_epint()
3200 if (dir_in && !hs_ep->isochronous) { in dwc2_hsotg_epint()
3219 dwc2_hsotg_trytx(hsotg, hs_ep); in dwc2_hsotg_epint()
3650 struct dwc2_hsotg_ep *hs_ep; in dwc2_gadget_handle_incomplete_isoc_in() local
3660 hs_ep = hsotg->eps_in[idx]; in dwc2_gadget_handle_incomplete_isoc_in()
3662 if ((BIT(idx) & ~daintmsk) || !hs_ep->isochronous) in dwc2_gadget_handle_incomplete_isoc_in()
3667 dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_gadget_handle_incomplete_isoc_in()
3697 struct dwc2_hsotg_ep *hs_ep; in dwc2_gadget_handle_incomplete_isoc_out() local
3706 hs_ep = hsotg->eps_out[idx]; in dwc2_gadget_handle_incomplete_isoc_out()
3708 if ((BIT(idx) & ~daintmsk) || !hs_ep->isochronous) in dwc2_gadget_handle_incomplete_isoc_out()
3713 dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_gadget_handle_incomplete_isoc_out()
3869 struct dwc2_hsotg_ep *hs_ep; in dwc2_hsotg_irq() local
3880 hs_ep = hsotg->eps_out[idx]; in dwc2_hsotg_irq()
3888 if ((epctrl & DXEPCTL_EPENA) && hs_ep->isochronous) { in dwc2_hsotg_irq()
3896 if (hs_ep->halted) { in dwc2_hsotg_irq()
3940 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_ep_stop_xfr() argument
3945 epctrl_reg = hs_ep->dir_in ? DIEPCTL(hs_ep->index) : in dwc2_hsotg_ep_stop_xfr()
3946 DOEPCTL(hs_ep->index); in dwc2_hsotg_ep_stop_xfr()
3947 epint_reg = hs_ep->dir_in ? DIEPINT(hs_ep->index) : in dwc2_hsotg_ep_stop_xfr()
3948 DOEPINT(hs_ep->index); in dwc2_hsotg_ep_stop_xfr()
3951 hs_ep->name); in dwc2_hsotg_ep_stop_xfr()
3953 if (hs_ep->dir_in) { in dwc2_hsotg_ep_stop_xfr()
3954 if (hsotg->dedicated_fifos || hs_ep->periodic) { in dwc2_hsotg_ep_stop_xfr()
4011 if (hs_ep->dir_in) { in dwc2_hsotg_ep_stop_xfr()
4014 if (hsotg->dedicated_fifos || hs_ep->periodic) in dwc2_hsotg_ep_stop_xfr()
4015 fifo_index = hs_ep->fifo_index; in dwc2_hsotg_ep_stop_xfr()
4023 if (!hsotg->dedicated_fifos && !hs_ep->periodic) in dwc2_hsotg_ep_stop_xfr()
4042 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_enable() local
4043 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_ep_enable()
4045 unsigned int index = hs_ep->index; in dwc2_hsotg_ep_enable()
4069 if (dir_in != hs_ep->dir_in) { in dwc2_hsotg_ep_enable()
4108 if (using_desc_dma(hsotg) && !hs_ep->desc_list) { in dwc2_hsotg_ep_enable()
4109 hs_ep->desc_list = dmam_alloc_coherent(hsotg->dev, in dwc2_hsotg_ep_enable()
4111 &hs_ep->desc_list_dma, GFP_ATOMIC); in dwc2_hsotg_ep_enable()
4112 if (!hs_ep->desc_list) { in dwc2_hsotg_ep_enable()
4130 dwc2_hsotg_set_ep_maxpacket(hsotg, hs_ep->index, mps, mc, dir_in); in dwc2_hsotg_ep_enable()
4133 hs_ep->isochronous = 0; in dwc2_hsotg_ep_enable()
4134 hs_ep->periodic = 0; in dwc2_hsotg_ep_enable()
4135 hs_ep->halted = 0; in dwc2_hsotg_ep_enable()
4136 hs_ep->interval = desc->bInterval; in dwc2_hsotg_ep_enable()
4142 hs_ep->isochronous = 1; in dwc2_hsotg_ep_enable()
4143 hs_ep->interval = 1 << (desc->bInterval - 1); in dwc2_hsotg_ep_enable()
4144 hs_ep->target_frame = TARGET_FRAME_INITIAL; in dwc2_hsotg_ep_enable()
4145 hs_ep->next_desc = 0; in dwc2_hsotg_ep_enable()
4146 hs_ep->compl_desc = 0; in dwc2_hsotg_ep_enable()
4148 hs_ep->periodic = 1; in dwc2_hsotg_ep_enable()
4166 hs_ep->periodic = 1; in dwc2_hsotg_ep_enable()
4169 hs_ep->interval = 1 << (desc->bInterval - 1); in dwc2_hsotg_ep_enable()
4188 size = hs_ep->ep.maxpacket * hs_ep->mc; in dwc2_hsotg_ep_enable()
4211 hs_ep->fifo_index = fifo_index; in dwc2_hsotg_ep_enable()
4212 hs_ep->fifo_size = fifo_size; in dwc2_hsotg_ep_enable()
4216 if (index && !hs_ep->isochronous) in dwc2_hsotg_ep_enable()
4226 hs_ep->isochronous && dir_in) { in dwc2_hsotg_ep_enable()
4254 if (ret && using_desc_dma(hsotg) && hs_ep->desc_list) { in dwc2_hsotg_ep_enable()
4257 hs_ep->desc_list, hs_ep->desc_list_dma); in dwc2_hsotg_ep_enable()
4258 hs_ep->desc_list = NULL; in dwc2_hsotg_ep_enable()
4270 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_disable() local
4271 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_ep_disable()
4272 int dir_in = hs_ep->dir_in; in dwc2_hsotg_ep_disable()
4273 int index = hs_ep->index; in dwc2_hsotg_ep_disable()
4294 dwc2_hsotg_ep_stop_xfr(hsotg, hs_ep); in dwc2_hsotg_ep_disable()
4304 dwc2_hsotg_ctrl_epint(hsotg, hs_ep->index, hs_ep->dir_in, 0); in dwc2_hsotg_ep_disable()
4307 kill_all_requests(hsotg, hs_ep, -ESHUTDOWN); in dwc2_hsotg_ep_disable()
4309 hsotg->fifo_map &= ~(1 << hs_ep->fifo_index); in dwc2_hsotg_ep_disable()
4310 hs_ep->fifo_index = 0; in dwc2_hsotg_ep_disable()
4311 hs_ep->fifo_size = 0; in dwc2_hsotg_ep_disable()
4318 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_disable_lock() local
4319 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_ep_disable_lock()
4354 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_dequeue() local
4355 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_dequeue()
4362 if (!on_list(hs_ep, hs_req)) { in dwc2_hsotg_ep_dequeue()
4368 if (req == &hs_ep->req->req) in dwc2_hsotg_ep_dequeue()
4369 dwc2_hsotg_ep_stop_xfr(hs, hs_ep); in dwc2_hsotg_ep_dequeue()
4371 dwc2_hsotg_complete_request(hs, hs_ep, hs_req, -ECONNRESET); in dwc2_hsotg_ep_dequeue()
4389 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_sethalt() local
4390 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_sethalt()
4391 int index = hs_ep->index; in dwc2_hsotg_ep_sethalt()
4407 if (hs_ep->isochronous) { in dwc2_hsotg_ep_sethalt()
4412 if (!now && value && !list_empty(&hs_ep->queue)) { in dwc2_hsotg_ep_sethalt()
4418 if (hs_ep->dir_in) { in dwc2_hsotg_ep_sethalt()
4455 hs_ep->halted = value; in dwc2_hsotg_ep_sethalt()
4466 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_sethalt_lock() local
4467 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_sethalt_lock()
4775 * @hs_ep: The endpoint to be initialised.
4784 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_initep() argument
4797 hs_ep->dir_in = dir_in; in dwc2_hsotg_initep()
4798 hs_ep->index = epnum; in dwc2_hsotg_initep()
4800 snprintf(hs_ep->name, sizeof(hs_ep->name), "ep%d%s", epnum, dir); in dwc2_hsotg_initep()
4802 INIT_LIST_HEAD(&hs_ep->queue); in dwc2_hsotg_initep()
4803 INIT_LIST_HEAD(&hs_ep->ep.ep_list); in dwc2_hsotg_initep()
4807 list_add_tail(&hs_ep->ep.ep_list, &hsotg->gadget.ep_list); in dwc2_hsotg_initep()
4809 hs_ep->parent = hsotg; in dwc2_hsotg_initep()
4810 hs_ep->ep.name = hs_ep->name; in dwc2_hsotg_initep()
4813 usb_ep_set_maxpacket_limit(&hs_ep->ep, 8); in dwc2_hsotg_initep()
4815 usb_ep_set_maxpacket_limit(&hs_ep->ep, in dwc2_hsotg_initep()
4817 hs_ep->ep.ops = &dwc2_hsotg_ep_ops; in dwc2_hsotg_initep()
4820 hs_ep->ep.caps.type_control = true; in dwc2_hsotg_initep()
4823 hs_ep->ep.caps.type_iso = true; in dwc2_hsotg_initep()
4824 hs_ep->ep.caps.type_bulk = true; in dwc2_hsotg_initep()
4826 hs_ep->ep.caps.type_int = true; in dwc2_hsotg_initep()
4830 hs_ep->ep.caps.dir_in = true; in dwc2_hsotg_initep()
4832 hs_ep->ep.caps.dir_out = true; in dwc2_hsotg_initep()