aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/udc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r--drivers/usb/chipidea/udc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 73a39ef93ec5..80de2f88ed2c 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -393,6 +393,14 @@ static int add_td_to_list(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq,
393 node->ptr->token = cpu_to_le32(length << __ffs(TD_TOTAL_BYTES)); 393 node->ptr->token = cpu_to_le32(length << __ffs(TD_TOTAL_BYTES));
394 node->ptr->token &= cpu_to_le32(TD_TOTAL_BYTES); 394 node->ptr->token &= cpu_to_le32(TD_TOTAL_BYTES);
395 node->ptr->token |= cpu_to_le32(TD_STATUS_ACTIVE); 395 node->ptr->token |= cpu_to_le32(TD_STATUS_ACTIVE);
396 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) {
397 u32 mul = hwreq->req.length / hwep->ep.maxpacket;
398
399 if (hwreq->req.length == 0
400 || hwreq->req.length % hwep->ep.maxpacket)
401 mul++;
402 node->ptr->token |= mul << __ffs(TD_MULTO);
403 }
396 404
397 temp = (u32) (hwreq->req.dma + hwreq->req.actual); 405 temp = (u32) (hwreq->req.dma + hwreq->req.actual);
398 if (length) { 406 if (length) {
@@ -515,10 +523,11 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
515 hwep->qh.ptr->td.token &= 523 hwep->qh.ptr->td.token &=
516 cpu_to_le32(~(TD_STATUS_HALTED|TD_STATUS_ACTIVE)); 524 cpu_to_le32(~(TD_STATUS_HALTED|TD_STATUS_ACTIVE));
517 525
518 if (hwep->type == USB_ENDPOINT_XFER_ISOC) { 526 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == RX) {
519 u32 mul = hwreq->req.length / hwep->ep.maxpacket; 527 u32 mul = hwreq->req.length / hwep->ep.maxpacket;
520 528
521 if (hwreq->req.length % hwep->ep.maxpacket) 529 if (hwreq->req.length == 0
530 || hwreq->req.length % hwep->ep.maxpacket)
522 mul++; 531 mul++;
523 hwep->qh.ptr->cap |= mul << __ffs(QH_MULT); 532 hwep->qh.ptr->cap |= mul << __ffs(QH_MULT);
524 } 533 }
@@ -1173,6 +1182,12 @@ static int ep_enable(struct usb_ep *ep,
1173 if (hwep->num) 1182 if (hwep->num)
1174 cap |= QH_ZLT; 1183 cap |= QH_ZLT;
1175 cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT; 1184 cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT;
1185 /*
1186 * For ISO-TX, we set mult at QH as the largest value, and use
1187 * MultO at TD as real mult value.
1188 */
1189 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX)
1190 cap |= 3 << __ffs(QH_MULT);
1176 1191
1177 hwep->qh.ptr->cap = cpu_to_le32(cap); 1192 hwep->qh.ptr->cap = cpu_to_le32(cap);
1178 1193