usb: dwc3: Prevent pipe_PowerDown transition during U1 exit

During U1 exit, the controller might send LFPS ping at the same
time when the P1 to P0 transition occurs(GUSB3PIPECTL[27] = '0').
The de-assertion of the pipe_TxElecIdle signal during the
pipe_PowerDown signal transition violates the PIPE specification.
Fix this by setting GUSB3PIPECTL[27] = '1' so that there is no
pipe_PowerDown transition during U1 exit. This fix is applicable
for DWC3 revision 3.10 or older.

Change-Id: I7708d42c0f8b67d315be59e9ff9f04ccb74b9b5c
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index e4e3dd6..ee06d07 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -249,6 +249,11 @@
 
 	reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
 	reg &= ~DWC3_GUSB3PIPECTL_DELAYP1TRANS;
+
+	/* core exits U1/U2/U3 only in PHY power state P1/P2/P3 respectively */
+	if (dwc->revision <= DWC3_REVISION_310A)
+		reg |= DWC3_GUSB3PIPECTL_UX_EXIT_IN_PX;
+
 	dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
 
 	dwc3_notify_event(dwc, DWC3_CONTROLLER_RESET_EVENT);