]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
usb: dwc3: core: Deprecate GCTL.CORESOFTRESET
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 16 Jun 2022 00:24:32 +0000 (17:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2022 13:15:59 +0000 (15:15 +0200)
[ Upstream commit afbd04e66e5d16ca3c7ea2e3c56eca25558eacf3 ]

Synopsys IP DWC_usb32 and DWC_usb31 version 1.90a and above deprecated
GCTL.CORESOFTRESET. The DRD mode switching flow is updated to remove the
GCTL soft reset. Add version checks to prevent using deprecated setting
in mode switching flow.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/9df529fde6e55f5508321b6bc26e92848044ef2b.1655338967.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/core.c

index d97da7cef8679bd81115d1dd1ffcff31f25dbd4a..8b1c83c13905ea5b90de493722cb5f089775e887 100644 (file)
@@ -159,7 +159,8 @@ static void __dwc3_set_mode(struct work_struct *work)
        }
 
        /* For DRD host or device mode only */
-       if (dwc->desired_dr_role != DWC3_GCTL_PRTCAP_OTG) {
+       if ((DWC3_IP_IS(DWC3) || DWC3_VER_IS_PRIOR(DWC31, 190A)) &&
+           dwc->desired_dr_role != DWC3_GCTL_PRTCAP_OTG) {
                reg = dwc3_readl(dwc->regs, DWC3_GCTL);
                reg |= DWC3_GCTL_CORESOFTRESET;
                dwc3_writel(dwc->regs, DWC3_GCTL, reg);