浏览代码

usb: dwc2: gadget: check interrupts for all endpoints

Current code does not check endpoint 15 interrupt. Use number
of endpoint configured in hardware instead of the hardcoded value.

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 年之前
父节点
当前提交
cec87f1d26
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/usb/dwc2/gadget.c

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

@@ -2337,12 +2337,14 @@ irq_retry:
 
 
 		dev_dbg(hsotg->dev, "%s: daint=%08x\n", __func__, daint);
 		dev_dbg(hsotg->dev, "%s: daint=%08x\n", __func__, daint);
 
 
-		for (ep = 0; ep < 15 && daint_out; ep++, daint_out >>= 1) {
+		for (ep = 0; ep < hsotg->num_of_eps && daint_out;
+						ep++, daint_out >>= 1) {
 			if (daint_out & 1)
 			if (daint_out & 1)
 				s3c_hsotg_epint(hsotg, ep, 0);
 				s3c_hsotg_epint(hsotg, ep, 0);
 		}
 		}
 
 
-		for (ep = 0; ep < 15 && daint_in; ep++, daint_in >>= 1) {
+		for (ep = 0; ep < hsotg->num_of_eps  && daint_in;
+						ep++, daint_in >>= 1) {
 			if (daint_in & 1)
 			if (daint_in & 1)
 				s3c_hsotg_epint(hsotg, ep, 1);
 				s3c_hsotg_epint(hsotg, ep, 1);
 		}
 		}