Lines Matching full:hs_ep

110  * @hs_ep: The endpoint
115 static inline void dwc2_gadget_incr_frame_num(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_incr_frame_num() argument
117 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_incr_frame_num()
123 hs_ep->target_frame += hs_ep->interval; in dwc2_gadget_incr_frame_num()
124 if (hs_ep->target_frame > limit) { in dwc2_gadget_incr_frame_num()
125 hs_ep->frame_overrun = true; in dwc2_gadget_incr_frame_num()
126 hs_ep->target_frame &= limit; in dwc2_gadget_incr_frame_num()
128 hs_ep->frame_overrun = false; in dwc2_gadget_incr_frame_num()
135 * @hs_ep: The endpoint.
142 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
144 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_dec_frame_num_by_one()
150 if (hs_ep->target_frame) in dwc2_gadget_dec_frame_num_by_one()
151 hs_ep->target_frame -= 1; in dwc2_gadget_dec_frame_num_by_one()
153 hs_ep->target_frame = limit; in dwc2_gadget_dec_frame_num_by_one()
411 * @hs_ep: The endpoint to query.
416 static inline int is_ep_periodic(struct dwc2_hsotg_ep *hs_ep) in is_ep_periodic() argument
418 return hs_ep->periodic; in is_ep_periodic()
424 * @hs_ep: The endpoint for the request
431 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_unmap_dma() argument
436 usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->map_dir); in dwc2_hsotg_unmap_dma()
490 * @hs_ep: The endpoint we're going to write for.
504 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_write_fifo() argument
507 bool periodic = is_ep_periodic(hs_ep); in dwc2_hsotg_write_fifo()
510 int to_write = hs_ep->size_loaded; in dwc2_hsotg_write_fifo()
516 to_write -= (buf_pos - hs_ep->last_load); in dwc2_hsotg_write_fifo()
523 u32 epsize = dwc2_readl(hsotg, DIEPTSIZ(hs_ep->index)); in dwc2_hsotg_write_fifo()
538 if (hs_ep->fifo_load != 0) { in dwc2_hsotg_write_fifo()
545 hs_ep->size_loaded, hs_ep->fifo_load, hs_ep->fifo_size); in dwc2_hsotg_write_fifo()
548 size_done = hs_ep->size_loaded - size_left; in dwc2_hsotg_write_fifo()
551 can_write = hs_ep->fifo_load - size_done; in dwc2_hsotg_write_fifo()
555 can_write = hs_ep->fifo_size - can_write; in dwc2_hsotg_write_fifo()
563 } else if (hsotg->dedicated_fifos && hs_ep->index != 0) { in dwc2_hsotg_write_fifo()
565 DTXFSTS(hs_ep->fifo_index)); in dwc2_hsotg_write_fifo()
583 max_transfer = hs_ep->ep.maxpacket * hs_ep->mc; in dwc2_hsotg_write_fifo()
647 hs_ep->total_data += to_write; in dwc2_hsotg_write_fifo()
650 hs_ep->fifo_load += to_write; in dwc2_hsotg_write_fifo()
655 dwc2_writel_rep(hsotg, EPFIFO(hs_ep->index), data, to_write); in dwc2_hsotg_write_fifo()
662 * @hs_ep: The endpoint
667 static unsigned int get_ep_limit(struct dwc2_hsotg_ep *hs_ep) in get_ep_limit() argument
669 int index = hs_ep->index; in get_ep_limit()
678 if (hs_ep->dir_in) in get_ep_limit()
693 if ((maxpkt * hs_ep->ep.maxpacket) < maxsize) in get_ep_limit()
694 maxsize = maxpkt * hs_ep->ep.maxpacket; in get_ep_limit()
719 * @hs_ep: The endpoint
725 static unsigned int dwc2_gadget_get_chain_limit(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_get_chain_limit() argument
727 const struct usb_endpoint_descriptor *ep_desc = hs_ep->ep.desc; in dwc2_gadget_get_chain_limit()
728 int is_isoc = hs_ep->isochronous; in dwc2_gadget_get_chain_limit()
730 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_get_chain_limit()
731 int dir_in = hs_ep->dir_in; in dwc2_gadget_get_chain_limit()
734 maxsize = (hs_ep->dir_in ? DEV_DMA_ISOC_TX_NBYTES_LIMIT : in dwc2_gadget_get_chain_limit()
741 if (hs_ep->index) in dwc2_gadget_get_chain_limit()
750 * @hs_ep: The endpoint
765 static u32 dwc2_gadget_get_desc_params(struct dwc2_hsotg_ep *hs_ep, u32 *mask) in dwc2_gadget_get_desc_params() argument
767 const struct usb_endpoint_descriptor *ep_desc = hs_ep->ep.desc; in dwc2_gadget_get_desc_params()
768 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_get_desc_params()
769 int dir_in = hs_ep->dir_in; in dwc2_gadget_get_desc_params()
772 if (!hs_ep->index && !dir_in) { in dwc2_gadget_get_desc_params()
775 } else if (hs_ep->isochronous) { in dwc2_gadget_get_desc_params()
792 if (hs_ep->index) in dwc2_gadget_get_desc_params()
801 static void dwc2_gadget_fill_nonisoc_xfer_ddma_one(struct dwc2_hsotg_ep *hs_ep, in dwc2_gadget_fill_nonisoc_xfer_ddma_one() argument
807 int dir_in = hs_ep->dir_in; in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
808 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
814 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
816 hs_ep->desc_count = (len / maxsize) + in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
819 hs_ep->desc_count = 1; in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
821 for (i = 0; i < hs_ep->desc_count; ++i) { in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
827 if (!hs_ep->index && !dir_in) in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
842 ((hs_ep->send_zlp && true_last) ? in dwc2_gadget_fill_nonisoc_xfer_ddma_one()
859 * @hs_ep: The endpoint
867 static void dwc2_gadget_config_nonisoc_xfer_ddma(struct dwc2_hsotg_ep *hs_ep, in dwc2_gadget_config_nonisoc_xfer_ddma() argument
872 struct dwc2_dma_desc *desc = hs_ep->desc_list; in dwc2_gadget_config_nonisoc_xfer_ddma()
877 if (hs_ep->req) in dwc2_gadget_config_nonisoc_xfer_ddma()
878 ureq = &hs_ep->req->req; in dwc2_gadget_config_nonisoc_xfer_ddma()
882 dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, in dwc2_gadget_config_nonisoc_xfer_ddma()
889 dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, in dwc2_gadget_config_nonisoc_xfer_ddma()
892 desc_count += hs_ep->desc_count; in dwc2_gadget_config_nonisoc_xfer_ddma()
895 hs_ep->desc_count = desc_count; in dwc2_gadget_config_nonisoc_xfer_ddma()
900 * @hs_ep: The isochronous endpoint.
909 static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, in dwc2_gadget_fill_isoc_desc() argument
913 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_fill_isoc_desc()
918 dwc2_gadget_get_desc_params(hs_ep, &mask); in dwc2_gadget_fill_isoc_desc()
920 index = hs_ep->next_desc; in dwc2_gadget_fill_isoc_desc()
921 desc = &hs_ep->desc_list[index]; in dwc2_gadget_fill_isoc_desc()
931 if (hs_ep->next_desc) in dwc2_gadget_fill_isoc_desc()
932 hs_ep->desc_list[index - 1].status &= ~DEV_DMA_L; in dwc2_gadget_fill_isoc_desc()
935 __func__, hs_ep->index, hs_ep->dir_in ? "in" : "out", index); in dwc2_gadget_fill_isoc_desc()
944 if (hs_ep->dir_in) { in dwc2_gadget_fill_isoc_desc()
946 pid = DIV_ROUND_UP(len, hs_ep->ep.maxpacket); in dwc2_gadget_fill_isoc_desc()
951 ((len % hs_ep->ep.maxpacket) ? in dwc2_gadget_fill_isoc_desc()
953 ((hs_ep->target_frame << in dwc2_gadget_fill_isoc_desc()
962 if (hs_ep->dir_in) in dwc2_gadget_fill_isoc_desc()
963 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_fill_isoc_desc()
966 hs_ep->next_desc++; in dwc2_gadget_fill_isoc_desc()
967 if (hs_ep->next_desc >= MAX_DMA_DESC_NUM_HS_ISOC) in dwc2_gadget_fill_isoc_desc()
968 hs_ep->next_desc = 0; in dwc2_gadget_fill_isoc_desc()
975 * @hs_ep: The isochronous endpoint.
980 static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_start_isoc_ddma() argument
982 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_start_isoc_ddma()
984 int index = hs_ep->index; in dwc2_gadget_start_isoc_ddma()
992 if (list_empty(&hs_ep->queue)) { in dwc2_gadget_start_isoc_ddma()
993 hs_ep->target_frame = TARGET_FRAME_INITIAL; in dwc2_gadget_start_isoc_ddma()
1000 desc = &hs_ep->desc_list[i]; in dwc2_gadget_start_isoc_ddma()
1006 hs_ep->next_desc = 0; in dwc2_gadget_start_isoc_ddma()
1007 list_for_each_entry_safe(hs_req, treq, &hs_ep->queue, queue) { in dwc2_gadget_start_isoc_ddma()
1014 ret = dwc2_gadget_fill_isoc_desc(hs_ep, dma_addr, in dwc2_gadget_start_isoc_ddma()
1020 hs_ep->compl_desc = 0; in dwc2_gadget_start_isoc_ddma()
1021 depctl = hs_ep->dir_in ? DIEPCTL(index) : DOEPCTL(index); in dwc2_gadget_start_isoc_ddma()
1022 dma_reg = hs_ep->dir_in ? DIEPDMA(index) : DOEPDMA(index); in dwc2_gadget_start_isoc_ddma()
1025 dwc2_writel(hsotg, hs_ep->desc_list_dma, dma_reg); in dwc2_gadget_start_isoc_ddma()
1032 static bool dwc2_gadget_target_frame_elapsed(struct dwc2_hsotg_ep *hs_ep);
1034 struct dwc2_hsotg_ep *hs_ep,
1041 * @hs_ep: The endpoint to process a request for
1049 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_start_req() argument
1054 int index = hs_ep->index; in dwc2_hsotg_start_req()
1055 int dir_in = hs_ep->dir_in; in dwc2_hsotg_start_req()
1066 if (hs_ep->req && !continuing) { in dwc2_hsotg_start_req()
1070 } else if (hs_ep->req != hs_req && continuing) { in dwc2_hsotg_start_req()
1084 hs_ep->dir_in ? "in" : "out"); in dwc2_hsotg_start_req()
1099 maxreq = get_ep_limit(hs_ep); in dwc2_hsotg_start_req()
1101 maxreq = dwc2_gadget_get_chain_limit(hs_ep); in dwc2_hsotg_start_req()
1104 int round = maxreq % hs_ep->ep.maxpacket; in dwc2_hsotg_start_req()
1117 packets = DIV_ROUND_UP(length, hs_ep->ep.maxpacket); in dwc2_hsotg_start_req()
1122 if (hs_ep->isochronous) in dwc2_hsotg_start_req()
1135 if ((ureq->length >= hs_ep->ep.maxpacket) && in dwc2_hsotg_start_req()
1136 !(ureq->length % hs_ep->ep.maxpacket)) in dwc2_hsotg_start_req()
1137 hs_ep->send_zlp = 1; in dwc2_hsotg_start_req()
1147 hs_ep->req = hs_req; in dwc2_hsotg_start_req()
1151 u32 mps = hs_ep->ep.maxpacket; in dwc2_hsotg_start_req()
1165 dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, ureq->dma + offset, in dwc2_hsotg_start_req()
1169 dwc2_writel(hsotg, hs_ep->desc_list_dma, dma_reg); in dwc2_hsotg_start_req()
1172 __func__, (u32)hs_ep->desc_list_dma, dma_reg); in dwc2_hsotg_start_req()
1190 if (hs_ep->isochronous) { in dwc2_hsotg_start_req()
1191 if (!dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_hsotg_start_req()
1192 if (hs_ep->interval == 1) { in dwc2_hsotg_start_req()
1193 if (hs_ep->target_frame & 0x1) in dwc2_hsotg_start_req()
1200 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_hsotg_start_req()
1202 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, -ENODATA); in dwc2_hsotg_start_req()
1223 hs_ep->size_loaded = length; in dwc2_hsotg_start_req()
1224 hs_ep->last_load = ureq->actual; in dwc2_hsotg_start_req()
1228 hs_ep->fifo_load = 0; in dwc2_hsotg_start_req()
1230 dwc2_hsotg_write_fifo(hsotg, hs_ep, hs_req); in dwc2_hsotg_start_req()
1248 dwc2_hsotg_ctrl_epint(hsotg, hs_ep->index, hs_ep->dir_in, 1); in dwc2_hsotg_start_req()
1254 * @hs_ep: The endpoint the request is on.
1264 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_map_dma() argument
1269 hs_ep->map_dir = hs_ep->dir_in; in dwc2_hsotg_map_dma()
1270 ret = usb_gadget_map_request(&hsotg->gadget, req, hs_ep->dir_in); in dwc2_hsotg_map_dma()
1284 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_handle_unaligned_buf_start() argument
1296 hs_ep->ep.name, req_buf, hs_req->req.length); in dwc2_hsotg_handle_unaligned_buf_start()
1310 if (hs_ep->dir_in) in dwc2_hsotg_handle_unaligned_buf_start()
1317 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_handle_unaligned_buf_complete() argument
1325 hs_ep->ep.name, hs_req->req.status, hs_req->req.actual); in dwc2_hsotg_handle_unaligned_buf_complete()
1328 if (!hs_ep->dir_in && !hs_req->req.status) in dwc2_hsotg_handle_unaligned_buf_complete()
1341 * @hs_ep: The driver endpoint to check
1346 static bool dwc2_gadget_target_frame_elapsed(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_target_frame_elapsed() argument
1348 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_target_frame_elapsed()
1349 u32 target_frame = hs_ep->target_frame; in dwc2_gadget_target_frame_elapsed()
1351 bool frame_overrun = hs_ep->frame_overrun; in dwc2_gadget_target_frame_elapsed()
1370 * @hs_ep: the ep descriptor chain is for
1376 struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_set_ep0_desc_chain() argument
1381 hs_ep->desc_list = hsotg->setup_desc[0]; in dwc2_gadget_set_ep0_desc_chain()
1382 hs_ep->desc_list_dma = hsotg->setup_desc_dma[0]; in dwc2_gadget_set_ep0_desc_chain()
1386 hs_ep->desc_list = hsotg->ctrl_in_desc; in dwc2_gadget_set_ep0_desc_chain()
1387 hs_ep->desc_list_dma = hsotg->ctrl_in_desc_dma; in dwc2_gadget_set_ep0_desc_chain()
1390 hs_ep->desc_list = hsotg->ctrl_out_desc; in dwc2_gadget_set_ep0_desc_chain()
1391 hs_ep->desc_list_dma = hsotg->ctrl_out_desc_dma; in dwc2_gadget_set_ep0_desc_chain()
1406 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_queue() local
1407 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_queue()
1431 if (hs_ep->isochronous && in dwc2_hsotg_ep_queue()
1432 req->length > (hs_ep->mc * hs_ep->ep.maxpacket)) { in dwc2_hsotg_ep_queue()
1440 if (using_desc_dma(hs) && hs_ep->isochronous) { in dwc2_hsotg_ep_queue()
1441 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); in dwc2_hsotg_ep_queue()
1442 if (hs_ep->dir_in && req->length > maxsize) { in dwc2_hsotg_ep_queue()
1448 if (!hs_ep->dir_in && req->length > hs_ep->ep.maxpacket) { in dwc2_hsotg_ep_queue()
1450 req->length, hs_ep->ep.maxpacket); in dwc2_hsotg_ep_queue()
1455 ret = dwc2_hsotg_handle_unaligned_buf_start(hs, hs_ep, hs_req); in dwc2_hsotg_ep_queue()
1461 ret = dwc2_hsotg_map_dma(hs, hs_ep, req); in dwc2_hsotg_ep_queue()
1466 if (using_desc_dma(hs) && !hs_ep->index) { in dwc2_hsotg_ep_queue()
1467 ret = dwc2_gadget_set_ep0_desc_chain(hs, hs_ep); in dwc2_hsotg_ep_queue()
1472 first = list_empty(&hs_ep->queue); in dwc2_hsotg_ep_queue()
1473 list_add_tail(&hs_req->queue, &hs_ep->queue); in dwc2_hsotg_ep_queue()
1481 if (using_desc_dma(hs) && hs_ep->isochronous) { in dwc2_hsotg_ep_queue()
1482 if (hs_ep->target_frame != TARGET_FRAME_INITIAL) { in dwc2_hsotg_ep_queue()
1489 dwc2_gadget_fill_isoc_desc(hs_ep, dma_addr, in dwc2_hsotg_ep_queue()
1496 if (!hs_ep->index && !req->length && !hs_ep->dir_in && in dwc2_hsotg_ep_queue()
1498 hs_ep->dir_in = 1; in dwc2_hsotg_ep_queue()
1501 if (!hs_ep->isochronous) { in dwc2_hsotg_ep_queue()
1502 dwc2_hsotg_start_req(hs, hs_ep, hs_req, false); in dwc2_hsotg_ep_queue()
1508 while (dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_hsotg_ep_queue()
1509 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_ep_queue()
1516 if (hs_ep->target_frame != TARGET_FRAME_INITIAL) in dwc2_hsotg_ep_queue()
1517 dwc2_hsotg_start_req(hs, hs_ep, hs_req, false); in dwc2_hsotg_ep_queue()
1525 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_queue_lock() local
1526 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_queue_lock()
1556 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_complete_oursetup() local
1557 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_complete_oursetup()
1724 * @hs_ep: The controller endpoint to get
1728 static struct dwc2_hsotg_req *get_ep_head(struct dwc2_hsotg_ep *hs_ep) in get_ep_head() argument
1730 return list_first_entry_or_null(&hs_ep->queue, struct dwc2_hsotg_req, in get_ep_head()
1736 * @hs_ep: Endpoint structure
1742 static void dwc2_gadget_start_next_request(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_start_next_request() argument
1744 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_start_next_request()
1745 int dir_in = hs_ep->dir_in; in dwc2_gadget_start_next_request()
1748 if (!list_empty(&hs_ep->queue)) { in dwc2_gadget_start_next_request()
1749 hs_req = get_ep_head(hs_ep); in dwc2_gadget_start_next_request()
1750 dwc2_hsotg_start_req(hsotg, hs_ep, hs_req, false); in dwc2_gadget_start_next_request()
1753 if (!hs_ep->isochronous) in dwc2_gadget_start_next_request()
2011 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_complete_setup() local
2012 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_complete_setup()
2067 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_program_zlp() argument
2070 u8 index = hs_ep->index; in dwc2_hsotg_program_zlp()
2071 u32 epctl_reg = hs_ep->dir_in ? DIEPCTL(index) : DOEPCTL(index); in dwc2_hsotg_program_zlp()
2072 u32 epsiz_reg = hs_ep->dir_in ? DIEPTSIZ(index) : DOEPTSIZ(index); in dwc2_hsotg_program_zlp()
2074 if (hs_ep->dir_in) in dwc2_hsotg_program_zlp()
2082 dma_addr_t dma = hs_ep->desc_list_dma; in dwc2_hsotg_program_zlp()
2085 dwc2_gadget_set_ep0_desc_chain(hsotg, hs_ep); in dwc2_hsotg_program_zlp()
2087 dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, dma, 0); in dwc2_hsotg_program_zlp()
2104 * @hs_ep: The endpoint the request was on.
2115 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_complete_request() argument
2125 hs_ep, hs_ep->ep.name, hs_req, result, hs_req->req.complete); in dwc2_hsotg_complete_request()
2136 dwc2_hsotg_unmap_dma(hsotg, hs_ep, hs_req); in dwc2_hsotg_complete_request()
2138 dwc2_hsotg_handle_unaligned_buf_complete(hsotg, hs_ep, hs_req); in dwc2_hsotg_complete_request()
2140 hs_ep->req = NULL; in dwc2_hsotg_complete_request()
2150 usb_gadget_giveback_request(&hs_ep->ep, &hs_req->req); in dwc2_hsotg_complete_request()
2155 if (using_desc_dma(hsotg) && hs_ep->isochronous) in dwc2_hsotg_complete_request()
2164 if (!hs_ep->req && result >= 0) in dwc2_hsotg_complete_request()
2165 dwc2_gadget_start_next_request(hs_ep); in dwc2_hsotg_complete_request()
2170 * @hs_ep: The endpoint the request was on.
2177 static void dwc2_gadget_complete_isoc_request_ddma(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_complete_isoc_request_ddma() argument
2179 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_complete_isoc_request_ddma()
2185 desc_sts = hs_ep->desc_list[hs_ep->compl_desc].status; in dwc2_gadget_complete_isoc_request_ddma()
2191 hs_req = get_ep_head(hs_ep); in dwc2_gadget_complete_isoc_request_ddma()
2201 mask = hs_ep->dir_in ? DEV_DMA_ISOC_TX_NBYTES_MASK : in dwc2_gadget_complete_isoc_request_ddma()
2209 if (!hs_ep->dir_in && ureq->length & 0x3) in dwc2_gadget_complete_isoc_request_ddma()
2218 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_gadget_complete_isoc_request_ddma()
2220 hs_ep->compl_desc++; in dwc2_gadget_complete_isoc_request_ddma()
2221 if (hs_ep->compl_desc > (MAX_DMA_DESC_NUM_HS_ISOC - 1)) in dwc2_gadget_complete_isoc_request_ddma()
2222 hs_ep->compl_desc = 0; in dwc2_gadget_complete_isoc_request_ddma()
2223 desc_sts = hs_ep->desc_list[hs_ep->compl_desc].status; in dwc2_gadget_complete_isoc_request_ddma()
2229 * @hs_ep: The isochronous endpoint.
2236 static void dwc2_gadget_handle_isoc_bna(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_handle_isoc_bna() argument
2238 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_handle_isoc_bna()
2240 if (!hs_ep->dir_in) in dwc2_gadget_handle_isoc_bna()
2242 dwc2_hsotg_complete_request(hsotg, hs_ep, get_ep_head(hs_ep), 0); in dwc2_gadget_handle_isoc_bna()
2244 hs_ep->target_frame = TARGET_FRAME_INITIAL; in dwc2_gadget_handle_isoc_bna()
2245 hs_ep->next_desc = 0; in dwc2_gadget_handle_isoc_bna()
2246 hs_ep->compl_desc = 0; in dwc2_gadget_handle_isoc_bna()
2261 struct dwc2_hsotg_ep *hs_ep = hsotg->eps_out[ep_idx]; in dwc2_hsotg_rx_data() local
2262 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_rx_data()
2299 hs_ep->total_data += to_read; in dwc2_hsotg_rx_data()
2334 * @hs_ep - The endpoint on which transfer went
2339 static unsigned int dwc2_gadget_get_xfersize_ddma(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_get_xfersize_ddma() argument
2341 const struct usb_endpoint_descriptor *ep_desc = hs_ep->ep.desc; in dwc2_gadget_get_xfersize_ddma()
2342 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_get_xfersize_ddma()
2345 struct dwc2_dma_desc *desc = hs_ep->desc_list; in dwc2_gadget_get_xfersize_ddma()
2348 u32 mps = hs_ep->ep.maxpacket; in dwc2_gadget_get_xfersize_ddma()
2349 int dir_in = hs_ep->dir_in; in dwc2_gadget_get_xfersize_ddma()
2355 if (hs_ep->index) in dwc2_gadget_get_xfersize_ddma()
2359 for (i = 0; i < hs_ep->desc_count; ++i) { in dwc2_gadget_get_xfersize_ddma()
2389 struct dwc2_hsotg_ep *hs_ep = hsotg->eps_out[epnum]; in dwc2_hsotg_handle_outdone() local
2390 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_handle_outdone()
2402 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_hsotg_handle_outdone()
2408 size_left = dwc2_gadget_get_xfersize_ddma(hs_ep); in dwc2_hsotg_handle_outdone()
2422 size_done = hs_ep->size_loaded - size_left; in dwc2_hsotg_handle_outdone()
2423 size_done += hs_ep->last_load; in dwc2_hsotg_handle_outdone()
2430 dwc2_hsotg_start_req(hsotg, hs_ep, hs_req, true); in dwc2_hsotg_handle_outdone()
2453 if (!using_desc_dma(hsotg) && hs_ep->isochronous) { in dwc2_hsotg_handle_outdone()
2454 req->frame_number = hs_ep->target_frame; in dwc2_hsotg_handle_outdone()
2455 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_handle_outdone()
2458 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, result); in dwc2_hsotg_handle_outdone()
2581 struct dwc2_hsotg_ep *hs_ep; in dwc2_hsotg_set_ep_maxpacket() local
2584 hs_ep = index_to_ep(hsotg, ep, dir_in); in dwc2_hsotg_set_ep_maxpacket()
2585 if (!hs_ep) in dwc2_hsotg_set_ep_maxpacket()
2595 hs_ep->ep.maxpacket = mps_bytes; in dwc2_hsotg_set_ep_maxpacket()
2596 hs_ep->mc = 1; in dwc2_hsotg_set_ep_maxpacket()
2600 hs_ep->mc = mc; in dwc2_hsotg_set_ep_maxpacket()
2603 hs_ep->ep.maxpacket = mps; in dwc2_hsotg_set_ep_maxpacket()
2643 * @hs_ep: The driver endpoint to check.
2649 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_trytx() argument
2651 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_trytx()
2653 if (!hs_ep->dir_in || !hs_req) { in dwc2_hsotg_trytx()
2658 if (hs_ep->index != 0) in dwc2_hsotg_trytx()
2659 dwc2_hsotg_ctrl_epint(hsotg, hs_ep->index, in dwc2_hsotg_trytx()
2660 hs_ep->dir_in, 0); in dwc2_hsotg_trytx()
2666 hs_ep->index); in dwc2_hsotg_trytx()
2667 return dwc2_hsotg_write_fifo(hsotg, hs_ep, hs_req); in dwc2_hsotg_trytx()
2676 * @hs_ep: The endpoint that has just completed.
2682 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_complete_in() argument
2684 struct dwc2_hsotg_req *hs_req = hs_ep->req; in dwc2_hsotg_complete_in()
2685 u32 epsize = dwc2_readl(hsotg, DIEPTSIZ(hs_ep->index)); in dwc2_hsotg_complete_in()
2694 if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_STATUS_IN) { in dwc2_hsotg_complete_in()
2701 hs_ep->dir_in = 0; in dwc2_hsotg_complete_in()
2703 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_hsotg_complete_in()
2729 size_left = dwc2_gadget_get_xfersize_ddma(hs_ep); in dwc2_hsotg_complete_in()
2737 size_done = hs_ep->size_loaded - size_left; in dwc2_hsotg_complete_in()
2738 size_done += hs_ep->last_load; in dwc2_hsotg_complete_in()
2750 dwc2_hsotg_start_req(hsotg, hs_ep, hs_req, true); in dwc2_hsotg_complete_in()
2755 if (hs_ep->send_zlp) { in dwc2_hsotg_complete_in()
2756 hs_ep->send_zlp = 0; in dwc2_hsotg_complete_in()
2758 dwc2_hsotg_program_zlp(hsotg, hs_ep); in dwc2_hsotg_complete_in()
2764 if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_DATA_IN) { in dwc2_hsotg_complete_in()
2771 if (!using_desc_dma(hsotg) && hs_ep->isochronous) { in dwc2_hsotg_complete_in()
2772 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_hsotg_complete_in()
2773 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_hsotg_complete_in()
2776 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0); in dwc2_hsotg_complete_in()
2809 * @hs_ep: The endpoint on which interrupt is asserted.
2820 static void dwc2_gadget_handle_ep_disabled(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_handle_ep_disabled() argument
2822 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_handle_ep_disabled()
2824 unsigned char idx = hs_ep->index; in dwc2_gadget_handle_ep_disabled()
2825 int dir_in = hs_ep->dir_in; in dwc2_gadget_handle_ep_disabled()
2834 dwc2_hsotg_txfifo_flush(hsotg, hs_ep->fifo_index); in dwc2_gadget_handle_ep_disabled()
2850 if (!hs_ep->isochronous) in dwc2_gadget_handle_ep_disabled()
2853 if (list_empty(&hs_ep->queue)) { in dwc2_gadget_handle_ep_disabled()
2855 __func__, hs_ep); in dwc2_gadget_handle_ep_disabled()
2860 hs_req = get_ep_head(hs_ep); in dwc2_gadget_handle_ep_disabled()
2862 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_gadget_handle_ep_disabled()
2864 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, in dwc2_gadget_handle_ep_disabled()
2867 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_ep_disabled()
2870 } while (dwc2_gadget_target_frame_elapsed(hs_ep)); in dwc2_gadget_handle_ep_disabled()
2936 struct dwc2_hsotg_ep *hs_ep);
2940 * @hs_ep: The endpoint on which interrupt is asserted.
2952 static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep) in dwc2_gadget_handle_nak() argument
2954 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_gadget_handle_nak()
2956 int dir_in = hs_ep->dir_in; in dwc2_gadget_handle_nak()
2959 if (!dir_in || !hs_ep->isochronous) in dwc2_gadget_handle_nak()
2962 if (hs_ep->target_frame == TARGET_FRAME_INITIAL) { in dwc2_gadget_handle_nak()
2965 hs_ep->target_frame = hsotg->frame_number; in dwc2_gadget_handle_nak()
2966 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_nak()
2975 hs_ep->target_frame &= ~hs_ep->interval + 1; in dwc2_gadget_handle_nak()
2980 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_nak()
2981 dwc2_gadget_dec_frame_num_by_one(hs_ep); in dwc2_gadget_handle_nak()
2984 dwc2_gadget_start_isoc_ddma(hs_ep); in dwc2_gadget_handle_nak()
2988 hs_ep->target_frame = hsotg->frame_number; in dwc2_gadget_handle_nak()
2989 if (hs_ep->interval > 1) { in dwc2_gadget_handle_nak()
2991 DIEPCTL(hs_ep->index)); in dwc2_gadget_handle_nak()
2992 if (hs_ep->target_frame & 0x1) in dwc2_gadget_handle_nak()
2997 dwc2_writel(hsotg, ctrl, DIEPCTL(hs_ep->index)); in dwc2_gadget_handle_nak()
3004 ctrl = dwc2_readl(hsotg, DIEPCTL(hs_ep->index)); in dwc2_gadget_handle_nak()
3006 dwc2_hsotg_ep_stop_xfr(hsotg, hs_ep); in dwc2_gadget_handle_nak()
3008 dwc2_hsotg_txfifo_flush(hsotg, hs_ep->fifo_index); in dwc2_gadget_handle_nak()
3010 while (dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_gadget_handle_nak()
3011 hs_req = get_ep_head(hs_ep); in dwc2_gadget_handle_nak()
3013 hs_req->req.frame_number = hs_ep->target_frame; in dwc2_gadget_handle_nak()
3015 dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, -ENODATA); in dwc2_gadget_handle_nak()
3018 dwc2_gadget_incr_frame_num(hs_ep); in dwc2_gadget_handle_nak()
3023 if (!hs_ep->req) in dwc2_gadget_handle_nak()
3024 dwc2_gadget_start_next_request(hs_ep); in dwc2_gadget_handle_nak()
3038 struct dwc2_hsotg_ep *hs_ep = index_to_ep(hsotg, idx, dir_in); in dwc2_hsotg_epint() local
3049 if (!hs_ep) { in dwc2_hsotg_epint()
3068 if (using_desc_dma(hsotg) && idx == 0 && !hs_ep->dir_in && in dwc2_hsotg_epint()
3079 if (using_desc_dma(hsotg) && hs_ep->isochronous) { in dwc2_hsotg_epint()
3080 dwc2_gadget_complete_isoc_request_ddma(hs_ep); in dwc2_hsotg_epint()
3087 if (!hs_ep->isochronous || !(ints & DXEPINT_NAKINTRPT)) in dwc2_hsotg_epint()
3088 dwc2_hsotg_complete_in(hsotg, hs_ep); in dwc2_hsotg_epint()
3090 if (idx == 0 && !hs_ep->req) in dwc2_hsotg_epint()
3097 if (!hs_ep->isochronous || !(ints & DXEPINT_OUTTKNEPDIS)) in dwc2_hsotg_epint()
3103 dwc2_gadget_handle_ep_disabled(hs_ep); in dwc2_hsotg_epint()
3106 dwc2_gadget_handle_out_token_ep_disabled(hs_ep); in dwc2_hsotg_epint()
3109 dwc2_gadget_handle_nak(hs_ep); in dwc2_hsotg_epint()
3161 if (hs_ep->isochronous) in dwc2_hsotg_epint()
3162 dwc2_gadget_handle_isoc_bna(hs_ep); in dwc2_hsotg_epint()
3165 if (dir_in && !hs_ep->isochronous) { in dwc2_hsotg_epint()
3184 dwc2_hsotg_trytx(hsotg, hs_ep); in dwc2_hsotg_epint()
3615 struct dwc2_hsotg_ep *hs_ep; in dwc2_gadget_handle_incomplete_isoc_in() local
3625 hs_ep = hsotg->eps_in[idx]; in dwc2_gadget_handle_incomplete_isoc_in()
3627 if ((BIT(idx) & ~daintmsk) || !hs_ep->isochronous) in dwc2_gadget_handle_incomplete_isoc_in()
3632 dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_gadget_handle_incomplete_isoc_in()
3662 struct dwc2_hsotg_ep *hs_ep; in dwc2_gadget_handle_incomplete_isoc_out() local
3671 hs_ep = hsotg->eps_out[idx]; in dwc2_gadget_handle_incomplete_isoc_out()
3673 if ((BIT(idx) & ~daintmsk) || !hs_ep->isochronous) in dwc2_gadget_handle_incomplete_isoc_out()
3678 dwc2_gadget_target_frame_elapsed(hs_ep)) { in dwc2_gadget_handle_incomplete_isoc_out()
3834 struct dwc2_hsotg_ep *hs_ep; in dwc2_hsotg_irq() local
3845 hs_ep = hsotg->eps_out[idx]; in dwc2_hsotg_irq()
3853 if ((epctrl & DXEPCTL_EPENA) && hs_ep->isochronous) { in dwc2_hsotg_irq()
3861 if (hs_ep->halted) { in dwc2_hsotg_irq()
3905 struct dwc2_hsotg_ep *hs_ep) in dwc2_hsotg_ep_stop_xfr() argument
3910 epctrl_reg = hs_ep->dir_in ? DIEPCTL(hs_ep->index) : in dwc2_hsotg_ep_stop_xfr()
3911 DOEPCTL(hs_ep->index); in dwc2_hsotg_ep_stop_xfr()
3912 epint_reg = hs_ep->dir_in ? DIEPINT(hs_ep->index) : in dwc2_hsotg_ep_stop_xfr()
3913 DOEPINT(hs_ep->index); in dwc2_hsotg_ep_stop_xfr()
3916 hs_ep->name); in dwc2_hsotg_ep_stop_xfr()
3918 if (hs_ep->dir_in) { in dwc2_hsotg_ep_stop_xfr()
3919 if (hsotg->dedicated_fifos || hs_ep->periodic) { in dwc2_hsotg_ep_stop_xfr()
3976 if (hs_ep->dir_in) { in dwc2_hsotg_ep_stop_xfr()
3979 if (hsotg->dedicated_fifos || hs_ep->periodic) in dwc2_hsotg_ep_stop_xfr()
3980 fifo_index = hs_ep->fifo_index; in dwc2_hsotg_ep_stop_xfr()
3988 if (!hsotg->dedicated_fifos && !hs_ep->periodic) in dwc2_hsotg_ep_stop_xfr()
4007 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_enable() local
4008 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_ep_enable()
4010 unsigned int index = hs_ep->index; in dwc2_hsotg_ep_enable()
4034 if (dir_in != hs_ep->dir_in) { in dwc2_hsotg_ep_enable()
4073 if (using_desc_dma(hsotg) && !hs_ep->desc_list) { in dwc2_hsotg_ep_enable()
4074 hs_ep->desc_list = dmam_alloc_coherent(hsotg->dev, in dwc2_hsotg_ep_enable()
4076 &hs_ep->desc_list_dma, GFP_ATOMIC); in dwc2_hsotg_ep_enable()
4077 if (!hs_ep->desc_list) { in dwc2_hsotg_ep_enable()
4095 dwc2_hsotg_set_ep_maxpacket(hsotg, hs_ep->index, mps, mc, dir_in); in dwc2_hsotg_ep_enable()
4098 hs_ep->isochronous = 0; in dwc2_hsotg_ep_enable()
4099 hs_ep->periodic = 0; in dwc2_hsotg_ep_enable()
4100 hs_ep->halted = 0; in dwc2_hsotg_ep_enable()
4101 hs_ep->wedged = 0; in dwc2_hsotg_ep_enable()
4102 hs_ep->interval = desc->bInterval; in dwc2_hsotg_ep_enable()
4108 hs_ep->isochronous = 1; in dwc2_hsotg_ep_enable()
4109 hs_ep->interval = 1 << (desc->bInterval - 1); in dwc2_hsotg_ep_enable()
4110 hs_ep->target_frame = TARGET_FRAME_INITIAL; in dwc2_hsotg_ep_enable()
4111 hs_ep->next_desc = 0; in dwc2_hsotg_ep_enable()
4112 hs_ep->compl_desc = 0; in dwc2_hsotg_ep_enable()
4114 hs_ep->periodic = 1; in dwc2_hsotg_ep_enable()
4132 hs_ep->periodic = 1; in dwc2_hsotg_ep_enable()
4135 hs_ep->interval = 1 << (desc->bInterval - 1); in dwc2_hsotg_ep_enable()
4154 size = hs_ep->ep.maxpacket * hs_ep->mc; in dwc2_hsotg_ep_enable()
4177 hs_ep->fifo_index = fifo_index; in dwc2_hsotg_ep_enable()
4178 hs_ep->fifo_size = fifo_size; in dwc2_hsotg_ep_enable()
4182 if (index && !hs_ep->isochronous) in dwc2_hsotg_ep_enable()
4192 hs_ep->isochronous && dir_in) { in dwc2_hsotg_ep_enable()
4220 if (ret && using_desc_dma(hsotg) && hs_ep->desc_list) { in dwc2_hsotg_ep_enable()
4223 hs_ep->desc_list, hs_ep->desc_list_dma); in dwc2_hsotg_ep_enable()
4224 hs_ep->desc_list = NULL; in dwc2_hsotg_ep_enable()
4236 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_disable() local
4237 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_ep_disable()
4238 int dir_in = hs_ep->dir_in; in dwc2_hsotg_ep_disable()
4239 int index = hs_ep->index; in dwc2_hsotg_ep_disable()
4260 dwc2_hsotg_ep_stop_xfr(hsotg, hs_ep); in dwc2_hsotg_ep_disable()
4270 dwc2_hsotg_ctrl_epint(hsotg, hs_ep->index, hs_ep->dir_in, 0); in dwc2_hsotg_ep_disable()
4273 kill_all_requests(hsotg, hs_ep, -ESHUTDOWN); in dwc2_hsotg_ep_disable()
4275 hsotg->fifo_map &= ~(1 << hs_ep->fifo_index); in dwc2_hsotg_ep_disable()
4276 hs_ep->fifo_index = 0; in dwc2_hsotg_ep_disable()
4277 hs_ep->fifo_size = 0; in dwc2_hsotg_ep_disable()
4284 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_disable_lock() local
4285 struct dwc2_hsotg *hsotg = hs_ep->parent; in dwc2_hsotg_ep_disable_lock()
4320 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_dequeue() local
4321 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_dequeue()
4328 if (!on_list(hs_ep, hs_req)) { in dwc2_hsotg_ep_dequeue()
4334 if (req == &hs_ep->req->req) in dwc2_hsotg_ep_dequeue()
4335 dwc2_hsotg_ep_stop_xfr(hs, hs_ep); in dwc2_hsotg_ep_dequeue()
4337 dwc2_hsotg_complete_request(hs, hs_ep, hs_req, -ECONNRESET); in dwc2_hsotg_ep_dequeue()
4350 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_gadget_ep_set_wedge() local
4351 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_gadget_ep_set_wedge()
4357 hs_ep->wedged = 1; in dwc2_gadget_ep_set_wedge()
4376 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_sethalt() local
4377 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_sethalt()
4378 int index = hs_ep->index; in dwc2_hsotg_ep_sethalt()
4394 if (hs_ep->isochronous) { in dwc2_hsotg_ep_sethalt()
4399 if (!now && value && !list_empty(&hs_ep->queue)) { in dwc2_hsotg_ep_sethalt()
4405 if (hs_ep->dir_in) { in dwc2_hsotg_ep_sethalt()
4415 hs_ep->wedged = 0; in dwc2_hsotg_ep_sethalt()
4435 hs_ep->wedged = 0; in dwc2_hsotg_ep_sethalt()
4444 hs_ep->halted = value; in dwc2_hsotg_ep_sethalt()
4455 struct dwc2_hsotg_ep *hs_ep = our_ep(ep); in dwc2_hsotg_ep_sethalt_lock() local
4456 struct dwc2_hsotg *hs = hs_ep->parent; in dwc2_hsotg_ep_sethalt_lock()
4779 * @hs_ep: The endpoint to be initialised.
4788 struct dwc2_hsotg_ep *hs_ep, in dwc2_hsotg_initep() argument
4801 hs_ep->dir_in = dir_in; in dwc2_hsotg_initep()
4802 hs_ep->index = epnum; in dwc2_hsotg_initep()
4804 snprintf(hs_ep->name, sizeof(hs_ep->name), "ep%d%s", epnum, dir); in dwc2_hsotg_initep()
4806 INIT_LIST_HEAD(&hs_ep->queue); in dwc2_hsotg_initep()
4807 INIT_LIST_HEAD(&hs_ep->ep.ep_list); in dwc2_hsotg_initep()
4811 list_add_tail(&hs_ep->ep.ep_list, &hsotg->gadget.ep_list); in dwc2_hsotg_initep()
4813 hs_ep->parent = hsotg; in dwc2_hsotg_initep()
4814 hs_ep->ep.name = hs_ep->name; in dwc2_hsotg_initep()
4817 usb_ep_set_maxpacket_limit(&hs_ep->ep, 8); in dwc2_hsotg_initep()
4819 usb_ep_set_maxpacket_limit(&hs_ep->ep, in dwc2_hsotg_initep()
4821 hs_ep->ep.ops = &dwc2_hsotg_ep_ops; in dwc2_hsotg_initep()
4824 hs_ep->ep.caps.type_control = true; in dwc2_hsotg_initep()
4827 hs_ep->ep.caps.type_iso = true; in dwc2_hsotg_initep()
4828 hs_ep->ep.caps.type_bulk = true; in dwc2_hsotg_initep()
4830 hs_ep->ep.caps.type_int = true; in dwc2_hsotg_initep()
4834 hs_ep->ep.caps.dir_in = true; in dwc2_hsotg_initep()
4836 hs_ep->ep.caps.dir_out = true; in dwc2_hsotg_initep()