瀏覽代碼

usb: dwc2: gadget: consider all tx fifos

When matching tx fifo to endpoint, consider all fifos instead of
hard limiting to 8
Moreover, print error in case no fifo could be found.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Mian Yousaf Kaukab 10 年之前
父節點
當前提交
5f2196bd7c
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/usb/dwc2/gadget.c

+ 4 - 2
drivers/usb/dwc2/gadget.c

@@ -2540,7 +2540,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep,
 	 */
 	 */
 	if (dir_in && hsotg->dedicated_fifos) {
 	if (dir_in && hsotg->dedicated_fifos) {
 		size = hs_ep->ep.maxpacket*hs_ep->mc;
 		size = hs_ep->ep.maxpacket*hs_ep->mc;
-		for (i = 1; i <= 8; ++i) {
+		for (i = 1; i < hsotg->num_of_eps; ++i) {
 			if (hsotg->fifo_map & (1<<i))
 			if (hsotg->fifo_map & (1<<i))
 				continue;
 				continue;
 			val = readl(hsotg->regs + DPTXFSIZN(i));
 			val = readl(hsotg->regs + DPTXFSIZN(i));
@@ -2554,7 +2554,9 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep,
 			hs_ep->fifo_size = val;
 			hs_ep->fifo_size = val;
 			break;
 			break;
 		}
 		}
-		if (i == 8) {
+		if (i == hsotg->num_of_eps) {
+			dev_err(hsotg->dev,
+				"%s: No suitable fifo found\n", __func__);
 			ret = -ENOMEM;
 			ret = -ENOMEM;
 			goto error;
 			goto error;
 		}
 		}