Skip to content

Commit

Permalink
usb: dwc3: gadget: set PCM1 field of isochronous-first TRBs
Browse files Browse the repository at this point in the history
In case of High-Speed, High-Bandwidth endpoints, we
need to tell DWC3 that we have more than one packet
per interval. We do that by setting PCM1 field of
Isochronous-First TRB.

Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Felipe Balbi committed Oct 31, 2016
1 parent eaa496f commit 6b9018d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,9 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
unsigned length, unsigned chain, unsigned node)
{
struct dwc3_trb *trb;
struct dwc3 *dwc = dep->dwc;
struct usb_gadget *gadget = &dwc->gadget;
enum usb_device_speed speed = gadget->speed;

dwc3_trace(trace_dwc3_gadget, "%s: req %p dma %08llx length %d%s",
dep->name, req, (unsigned long long) dma,
Expand Down Expand Up @@ -798,10 +801,16 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
break;

case USB_ENDPOINT_XFER_ISOC:
if (!node)
if (!node) {
trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS_FIRST;
else

if (speed == USB_SPEED_HIGH) {
struct usb_ep *ep = &dep->endpoint;
trb->size |= DWC3_TRB_SIZE_PCM1(ep->mult - 1);
}
} else {
trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS;
}

/* always enable Interrupt on Missed ISOC */
trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;
Expand Down

0 comments on commit 6b9018d

Please sign in to comment.