From: Thinh Nguyen Date: Fri, 16 Mar 2018 22:34:13 +0000 (-0700) Subject: usb: dwc3: gadget: Check IP revision for GRXTHRCFG X-Git-Tag: v5.15~9124^2~18^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01b0e2cc7d89b6aa4084993634b3ea673caff4e8;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 1431a88..19cf9c0 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);