summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>2018-03-16 15:34:13 -0700
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-22 10:48:53 +0200
commit01b0e2cc7d89b6aa4084993634b3ea673caff4e8 (patch)
tree5c7bf4c88ec102fc331108a464318f2c781e7c54
parent2fbc5bdc8fd1afa6d47223f6a4251f04c7d8fe7c (diff)
downloadlinux-stable-01b0e2cc7d89b6aa4084993634b3ea673caff4e8.tar.gz
linux-stable-01b0e2cc7d89b6aa4084993634b3ea673caff4e8.tar.bz2
linux-stable-01b0e2cc7d89b6aa4084993634b3ea673caff4e8.zip
usb: dwc3: gadget: Check IP revision for GRXTHRCFG
DWC_usb31 controller has a different UsbRxPktCnt bit fields from GRXTHRCFG register. Check for DWC_usb31 IP revision to read the appropriate value. Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc3/gadget.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 1431a88437af..19cf9c0eef12 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1858,7 +1858,11 @@ static int __dwc3_gadget_start(struct dwc3 *dwc)
* bursts of data without going through any sort of endpoint throttling.
*/
reg = dwc3_readl(dwc->regs, DWC3_GRXTHRCFG);
- reg &= ~DWC3_GRXTHRCFG_PKTCNTSEL;
+ if (dwc3_is_usb31(dwc))
+ reg &= ~DWC31_GRXTHRCFG_PKTCNTSEL;
+ else
+ reg &= ~DWC3_GRXTHRCFG_PKTCNTSEL;
+
dwc3_writel(dwc->regs, DWC3_GRXTHRCFG, reg);
dwc3_gadget_setup_nump(dwc);