@@ -2342,10 +2342,18 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
2342
2342
u32 reg ;
2343
2343
int i ;
2344
2344
2345
- dwc -> susphy_state = (dwc3_readl (dwc -> regs , DWC3_GUSB2PHYCFG (0 )) &
2346
- DWC3_GUSB2PHYCFG_SUSPHY ) ||
2347
- (dwc3_readl (dwc -> regs , DWC3_GUSB3PIPECTL (0 )) &
2348
- DWC3_GUSB3PIPECTL_SUSPHY );
2345
+ if (!pm_runtime_suspended (dwc -> dev ) && !PMSG_IS_AUTO (msg )) {
2346
+ dwc -> susphy_state = (dwc3_readl (dwc -> regs , DWC3_GUSB2PHYCFG (0 )) &
2347
+ DWC3_GUSB2PHYCFG_SUSPHY ) ||
2348
+ (dwc3_readl (dwc -> regs , DWC3_GUSB3PIPECTL (0 )) &
2349
+ DWC3_GUSB3PIPECTL_SUSPHY );
2350
+ /*
2351
+ * TI AM62 platform requires SUSPHY to be
2352
+ * enabled for system suspend to work.
2353
+ */
2354
+ if (!dwc -> susphy_state )
2355
+ dwc3_enable_susphy (dwc , true);
2356
+ }
2349
2357
2350
2358
switch (dwc -> current_dr_role ) {
2351
2359
case DWC3_GCTL_PRTCAP_DEVICE :
@@ -2398,15 +2406,6 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
2398
2406
break ;
2399
2407
}
2400
2408
2401
- if (!PMSG_IS_AUTO (msg )) {
2402
- /*
2403
- * TI AM62 platform requires SUSPHY to be
2404
- * enabled for system suspend to work.
2405
- */
2406
- if (!dwc -> susphy_state )
2407
- dwc3_enable_susphy (dwc , true);
2408
- }
2409
-
2410
2409
return 0 ;
2411
2410
}
2412
2411
0 commit comments