diff options
author | Thinh Nguyen <Thinh.Nguyen@synopsys.com> | 2018-03-16 23:34:00 +0100 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-03-22 09:48:50 +0100 |
commit | d548a61767fad7a0e6d89b118daeed2f5b8a8c2f (patch) | |
tree | c8379250c4b7323e23c6e2bef342a94aca484408 /drivers/usb | |
parent | usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields (diff) | |
download | linux-d548a61767fad7a0e6d89b118daeed2f5b8a8c2f.tar.xz linux-d548a61767fad7a0e6d89b118daeed2f5b8a8c2f.zip |
usb: dwc3: Check IP revision for GTXFIFOSIZ
DWC_usb31 controller has different GTXFIFOSIZE bit field for TXFDEF.
Check for DWC_usb31 IP revision to read the appropriate bit fields.
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7c3a6e4ea2a6..1431a88437af 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2118,7 +2118,10 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total) mdwidth /= 8; size = dwc3_readl(dwc->regs, DWC3_GTXFIFOSIZ(num)); - size = DWC3_GTXFIFOSIZ_TXFDEF(size); + if (dwc3_is_usb31(dwc)) + size = DWC31_GTXFIFOSIZ_TXFDEF(size); + else + size = DWC3_GTXFIFOSIZ_TXFDEF(size); /* FIFO Depth is in MDWDITH bytes. Multiply */ size *= mdwidth; |