From: Seung-Woo Kim Date: Tue, 9 Jun 2020 10:34:27 +0000 (+0900) Subject: usb: dwc2: gadget: do not reset during core phy init X-Git-Tag: accepted/tizen/unified/20200709.164653~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26f8b13d5ed70b8fb9b77584d2abe978de5bce0e;p=platform%2Fkernel%2Flinux-rpi.git usb: dwc2: gadget: do not reset during core phy init After the commit 1e868545f2bb ("usb: dwc2: gadget: Move gadget phy init into core phy init"), dwc2 gadget mode with f_fs enumeration is blocked from recent host kernel. It is because, the commit adds more usb reset for gadget case, so do not reset during core phy init for gadget. Change-Id: I389d56346430d5c27b775270a4cb05b608668c30 Signed-off-by: Seung-Woo Kim --- diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 8cd9ba3..6d7f0c7 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -1068,13 +1068,16 @@ static int dwc2_fs_phy_init(struct dwc2_hsotg *hsotg, bool select_phy) usbcfg |= GUSBCFG_PHYSEL; dwc2_writel(hsotg, usbcfg, GUSBCFG); - /* Reset after a PHY select */ - retval = dwc2_core_reset(hsotg, false); - - if (retval) { - dev_err(hsotg->dev, - "%s: Reset failed, aborting", __func__); - return retval; + if (dwc2_is_host_mode(hsotg)) { + /* Reset after a PHY select */ + retval = dwc2_core_reset(hsotg, false); + + if (retval) { + dev_err(hsotg->dev, + "%s: Reset failed, aborting", + __func__); + return retval; + } } } @@ -1175,12 +1178,14 @@ static int dwc2_hs_phy_init(struct dwc2_hsotg *hsotg, bool select_phy) if (usbcfg != usbcfg_old) { dwc2_writel(hsotg, usbcfg, GUSBCFG); - /* Reset after setting the PHY parameters */ - retval = dwc2_core_reset(hsotg, false); - if (retval) { - dev_err(hsotg->dev, - "%s: Reset failed, aborting", __func__); - return retval; + if (dwc2_is_host_mode(hsotg)) { + /* Reset after setting the PHY parameters */ + retval = dwc2_core_reset(hsotg, false); + if (retval) { + dev_err(hsotg->dev, + "%s: Reset failed, aborting", __func__); + return retval; + } } }