summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2014-05-06 15:44:50 +0200
committerSebastian Reichel <sre@kernel.org>2014-05-06 15:44:50 +0200
commit695f5ec02203ef23f127eacb86991d23307f3c6f (patch)
treeecb9c29268fa34559dfa06472d991bc5d92708be /drivers/usb/dwc3/gadget.c
parent5bdeae302496a8ac49848f4fed26b1d87a67d966 (diff)
parent793ec5f7dccf95c0d6d5d57a925a13261a7cbd2b (diff)
downloadlinux-695f5ec02203ef23f127eacb86991d23307f3c6f.tar.bz2
Merge branch 'n900-modem-support' into n900-dt-with-ssin900-dt-with-ssi
Conflicts: arch/arm/boot/dts/omap3-n900.dts
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a740eac74d56..70715eeededd 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -187,15 +187,12 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
* improve this algorithm so that we better use the internal
* FIFO space
*/
- for (num = 0; num < DWC3_ENDPOINTS_NUM; num++) {
- struct dwc3_ep *dep = dwc->eps[num];
- int fifo_number = dep->number >> 1;
+ for (num = 0; num < dwc->num_in_eps; num++) {
+ /* bit0 indicates direction; 1 means IN ep */
+ struct dwc3_ep *dep = dwc->eps[(num << 1) | 1];
int mult = 1;
int tmp;
- if (!(dep->number & 1))
- continue;
-
if (!(dep->flags & DWC3_EP_ENABLED))
continue;
@@ -224,8 +221,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n",
dep->name, last_fifo_depth, fifo_size & 0xffff);
- dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(fifo_number),
- fifo_size);
+ dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num), fifo_size);
last_fifo_depth += (fifo_size & 0xffff);
}