diff options
author | Mian Yousaf Kaukab <yousaf.kaukab@intel.com> | 2015-01-09 07:38:56 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-12 16:33:54 -0500 |
commit | 5f2196bd7c72cbead9d47da32816dd69a06b692e (patch) | |
tree | 071db758277715128dcefb86dc560aedd3795d6c /drivers/usb/dwc2/gadget.c | |
parent | 364f8e933869699167db935e13b41b1d92ab369d (diff) |
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>
Diffstat (limited to 'drivers/usb/dwc2/gadget.c')
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 7dfda954aba1..cd8880d6be53 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
@@ -2540,7 +2540,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2540 | */ | 2540 | */ |
2541 | if (dir_in && hsotg->dedicated_fifos) { | 2541 | if (dir_in && hsotg->dedicated_fifos) { |
2542 | size = hs_ep->ep.maxpacket*hs_ep->mc; | 2542 | size = hs_ep->ep.maxpacket*hs_ep->mc; |
2543 | for (i = 1; i <= 8; ++i) { | 2543 | for (i = 1; i < hsotg->num_of_eps; ++i) { |
2544 | if (hsotg->fifo_map & (1<<i)) | 2544 | if (hsotg->fifo_map & (1<<i)) |
2545 | continue; | 2545 | continue; |
2546 | val = readl(hsotg->regs + DPTXFSIZN(i)); | 2546 | val = readl(hsotg->regs + DPTXFSIZN(i)); |
@@ -2554,7 +2554,9 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2554 | hs_ep->fifo_size = val; | 2554 | hs_ep->fifo_size = val; |
2555 | break; | 2555 | break; |
2556 | } | 2556 | } |
2557 | if (i == 8) { | 2557 | if (i == hsotg->num_of_eps) { |
2558 | dev_err(hsotg->dev, | ||
2559 | "%s: No suitable fifo found\n", __func__); | ||
2558 | ret = -ENOMEM; | 2560 | ret = -ENOMEM; |
2559 | goto error; | 2561 | goto error; |
2560 | } | 2562 | } |