Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289622
b: refs/heads/master
c: 2e81c36
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed Feb 6, 2012
1 parent a1d4bb0 commit d8fa4cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d70d84423cbc5d6d929640189cf204e693024309
refs/heads/master: 2e81c36a00d0eb8ce72faaaec1a1d865617374ae
20 changes: 18 additions & 2 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
for (num = 0; num < DWC3_ENDPOINTS_NUM; num++) {
struct dwc3_ep *dep = dwc->eps[num];
int fifo_number = dep->number >> 1;
int mult = 1;
int tmp;

if (!(dep->number & 1))
Expand All @@ -180,11 +181,26 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
if (!(dep->flags & DWC3_EP_ENABLED))
continue;

tmp = dep->endpoint.maxpacket;
tmp += mdwidth;
if (usb_endpoint_xfer_bulk(dep->desc)
|| usb_endpoint_xfer_isoc(dep->desc))
mult = 3;

/*
* REVISIT: the following assumes we will always have enough
* space available on the FIFO RAM for all possible use cases.
* Make sure that's true somehow and change FIFO allocation
* accordingly.
*
* If we have Bulk or Isochronous endpoints, we want
* them to be able to be very, very fast. So we're giving
* those endpoints a fifo_size which is enough for 3 full
* packets
*/
tmp = mult * (dep->endpoint.maxpacket + mdwidth);
tmp += mdwidth;

fifo_size = DIV_ROUND_UP(tmp, mdwidth);

fifo_size |= (last_fifo_depth << 16);

dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n",
Expand Down

0 comments on commit d8fa4cc

Please sign in to comment.