mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
usb: dwc3-msm: Add support for snps SSPHY suspend in system suspend
Currently the platforms using SNPS SSPHY do not suspend it so as to receive SS wakeup events via pwr_event_irq. But certain telematics platforms do not need SS wakeup in system suspend scenario. USB wakeup from PM suspend/hibernation is not a requirement for automotive/telematics platforms. Use enable_wakeup parameter in dwc3_msm_suspend call to allow SSPHY suspend to happen and also to keep the IRQs enabled/disabled. Change-Id: I691585e15539490e63a345fe2b3aacf182352399 Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org> Signed-off-by: Harsh Agarwal <harshq@codeaurora.org>
This commit is contained in:
parent
74b8a97e90
commit
b595281eb8
1 changed files with 10 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue