mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
soc: swr-mstr-ctrl: allow runtime suspend first before system suspend
Allow the swrm to runtime suspend first before entering system suspend. This will prevent suspend being blocked for about 700ms. Change-Id: I8f90a9f1ba4f6af0decc256cace2f3bd2295dece Signed-off-by: Yunxian He <[email protected]> Mot-CRs-fixed: (CR) CRs-Fixed: 06687863 Reviewed-on: https://gerrit.mot.com/2784008 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hujun Liao <[email protected]> Reviewed-by: Xiangpo Zhao <[email protected]> Submit-Approved: Jira Key
This commit is contained in:
parent
7bd15a4f60
commit
617ded8e1a
1 changed files with 16 additions and 1 deletions
|
|
@ -3819,7 +3819,21 @@ static int swrm_suspend(struct device *dev)
|
|||
dev_dbg(swrm->dev, "%s: suspending system, state %d, wlock %d\n",
|
||||
__func__, swrm->pm_state,
|
||||
swrm->wlock_holders);
|
||||
swrm->pm_state = SWRM_PM_ASLEEP;
|
||||
/*
|
||||
* before updating the pm_state to ASLEEP, check if device is
|
||||
* runtime suspended or not. If it is not, then first make it
|
||||
* runtime suspend, and then update the pm_state to ASLEEP.
|
||||
*/
|
||||
mutex_unlock(&swrm->pm_lock); /* release pm_lock before dev suspend */
|
||||
swrm_device_suspend(swrm->dev); /* runtime suspend the device */
|
||||
mutex_lock(&swrm->pm_lock); /* acquire pm_lock and update state */
|
||||
if (swrm->pm_state == SWRM_PM_SLEEPABLE) {
|
||||
swrm->pm_state = SWRM_PM_ASLEEP;
|
||||
} else if (swrm->pm_state == SWRM_PM_AWAKE) {
|
||||
ret = -EBUSY;
|
||||
mutex_unlock(&swrm->pm_lock);
|
||||
goto check_ebusy;
|
||||
}
|
||||
} else if (swrm->pm_state == SWRM_PM_AWAKE) {
|
||||
/*
|
||||
* unlock to wait for pm_state == SWRM_PM_SLEEPABLE
|
||||
|
|
@ -3872,6 +3886,7 @@ static int swrm_suspend(struct device *dev)
|
|||
pm_runtime_enable(dev);
|
||||
}
|
||||
}
|
||||
check_ebusy:
|
||||
if (ret == -EBUSY) {
|
||||
/*
|
||||
* There is a possibility that some audio stream is active
|
||||
|
|
|
|||
Loading…
Reference in a new issue