diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 4d5915a1e7ed..f578fbed9d24 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -2851,7 +2851,8 @@ static int dwc3_msm_update_bus_bw(struct dwc3_msm *mdwc, enum bus_vote bv) return ret; } -static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse) +static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse, + bool enable_wakeup) { int ret; struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3); @@ -2944,7 +2945,8 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse) ((mdwc->hs_phy->flags & (PHY_HSFS_MODE | PHY_LS_MODE)) && !dwc3_msm_is_superspeed(mdwc))); can_suspend_ssphy = dwc->maximum_speed >= USB_SPEED_SUPER && - (!mdwc->use_pwr_event_for_wakeup || no_active_ss); + (!mdwc->use_pwr_event_for_wakeup || no_active_ss || + !enable_wakeup); /* Suspend SS PHY */ if (can_suspend_ssphy) { if (mdwc->in_host_mode) { @@ -3015,7 +3017,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse) * using HS_PHY_IRQ or SS_PHY_IRQ. Hence enable wakeup only in * case of host bus suspend and device bus suspend. */ - if (!(mdwc->lpm_flags & MDWC3_POWER_COLLAPSE)) { + if (!(mdwc->lpm_flags & MDWC3_POWER_COLLAPSE) && enable_wakeup) { if (mdwc->use_pdc_interrupts) { enable_usb_pdc_interrupt(mdwc, true); } else { @@ -5313,7 +5315,8 @@ static int dwc3_msm_pm_suspend(struct device *dev) return 0; } - ret = dwc3_msm_suspend(mdwc, false); + /* Wakeup not required for automotive/telematics platform host mode */ + ret = dwc3_msm_suspend(mdwc, false, false); if (!ret) atomic_set(&mdwc->pm_suspended, 1); @@ -5385,8 +5388,9 @@ static int dwc3_msm_pm_freeze(struct device *dev) /* * Power collapse the core. Hence call dwc3_msm_suspend with * 'force_power_collapse' set to 'true'. + * Wakeup not required for automotive/telematics platform host mode. */ - ret = dwc3_msm_suspend(mdwc, true); + ret = dwc3_msm_suspend(mdwc, true, false); if (!ret) atomic_set(&mdwc->pm_suspended, 1); @@ -5449,7 +5453,7 @@ static int dwc3_msm_runtime_suspend(struct device *dev) dev_dbg(dev, "DWC3-msm runtime suspend\n"); dbg_event(0xFF, "RT Sus", 0); - return dwc3_msm_suspend(mdwc, false); + return dwc3_msm_suspend(mdwc, false, true); } static int dwc3_msm_runtime_resume(struct device *dev)