usb: dwc3: gadget: fix fifo number for txfifo resize

If the dep resoure is assigned to an EP-IN, and the EP-IN
has not yet be enabled, we need to increase the fifo number
rather than skip out directly.

Fixes: 49b5c0d29f ("usb: dwc3: gadget: fix ep init for unequal num of in/out eps")
Change-Id: I6d45f859edda52542d421e1711138f69050dd90f
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2020-08-22 16:32:55 +08:00
parent 82a3ccbb1c
commit d4037f52e2

View File

@@ -180,10 +180,14 @@ static int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
int tmp; int tmp;
/* Skip out endpoints */ /* Skip out endpoints */
if (!dep || !dep->direction || if (!dep || !dep->direction)
!(dep->flags & DWC3_EP_ENABLED))
continue; continue;
if (!(dep->flags & DWC3_EP_ENABLED)) {
fifo_number++;
continue;
}
if (usb_endpoint_xfer_bulk(dep->endpoint.desc)) { if (usb_endpoint_xfer_bulk(dep->endpoint.desc)) {
mult = 3; mult = 3;
} else if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { } else if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {