Skip to contentSkip to conversation

ASoC: ti: davinci-mcasp: Add system suspend/resume support

PATCH In review Sen Wang 6 participants 6 messages Feb 11 – Feb 25

Subsystems (3)
lore
Share & tools
lore

Sen Wang

author maintainer
#0 lore raw

PATCH 1/1 ASoC: ti: davinci-mcasp: Add system suspend/resume support

The McASP driver supports runtime PM callbacks for register save/restore during device idle, but doesn't provide system suspend/resume callbacks. This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse existing runtime PM logics.

---
Tested on SK-AM62Px with audio playback during system suspend/resume cycles

Testlog:
https://gist.github.com/SenWang125/065c2840071f2569a79db9e99010603f

 sound/soc/ti/davinci-mcasp.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/ti/davinci-mcasp.c +2 -0
index 8a2977093df1..643661ebee83 100644
@@ -2811,6 +2811,8 @@ static int davinci_mcasp_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops davinci_mcasp_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 	SET_RUNTIME_PM_OPS(davinci_mcasp_runtime_suspend,
 			   davinci_mcasp_runtime_resume,
 			   NULL)
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Sen Wang

The McASP driver supports runtime PM callbacks for register save/restore during device idle, but doesn't provide system suspend/resume callbacks. This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse existing runtime PM logics.

Quoted 24 lines

---
Tested on SK-AM62Px with audio playback during system suspend/resume cycles

Testlog:
https://gist.github.com/SenWang125/065c2840071f2569a79db9e99010603f

 sound/soc/ti/davinci-mcasp.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/ti/davinci-mcasp.c +2 -0
index 8a2977093df1..643661ebee83 100644
@@ -2811,6 +2811,8 @@ static int davinci_mcasp_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops davinci_mcasp_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 	SET_RUNTIME_PM_OPS(davinci_mcasp_runtime_suspend,
 			   davinci_mcasp_runtime_resume,
 			   NULL)
Signature · 1 line
Péter
Reviewed-by on v1 1/1
#2 lore raw
In reply to Sen Wang
Quoted 8 lines · Sen Wang

The McASP driver supports runtime PM callbacks for register save/restore during device idle, but doesn't provide system suspend/resume callbacks. This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse existing runtime PM logics.

Regards
Devarsh

Quoted 22 lines

---
Tested on SK-AM62Px with audio playback during system suspend/resume cycles

Testlog:
https://gist.github.com/SenWang125/065c2840071f2569a79db9e99010603f

 sound/soc/ti/davinci-mcasp.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/ti/davinci-mcasp.c +2 -0
index 8a2977093df1..643661ebee83 100644
@@ -2811,6 +2811,8 @@ static int davinci_mcasp_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops davinci_mcasp_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 	SET_RUNTIME_PM_OPS(davinci_mcasp_runtime_suspend,
 			   davinci_mcasp_runtime_resume,
 			   NULL)
Reviewed-by on v1 1/1
#3 lore raw
In reply to Sen Wang
Quoted 22 lines · Sen Wang

The McASP driver supports runtime PM callbacks for register save/restore during device idle, but doesn't provide system suspend/resume callbacks. This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse existing runtime PM logics.

---
Tested on SK-AM62Px with audio playback during system suspend/resume cycles

Testlog:

   https://gist.github.com/SenWang125/065c2840071f2569a79db9e99010603f
  sound/soc/ti/davinci-mcasp.c | 2 ++
  1 file changed, 2 insertions(+)
sound/soc/ti/davinci-mcasp.c +0 -0
index 8a2977093df1..643661ebee83 100644

sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_runtime_resume(struct device *dev) · line 2818

Quoted 8 lines
sound/soc/ti/davinci-mcasp.c +2 -0
@@ -2811,6 +2811,8 @@ static int davinci_mcasp_runtime_resume(struct device *dev)
  #endif
 
  static const struct dev_pm_ops davinci_mcasp_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
  	SET_RUNTIME_PM_OPS(davinci_mcasp_runtime_suspend,
  			   davinci_mcasp_runtime_resume,
  			   NULL)
Tested-by on v1 1/1
#4 lore raw
In reply to Sen Wang
Quoted 22 lines · Sen Wang

The McASP driver supports runtime PM callbacks for register save/restore during device idle, but doesn't provide system suspend/resume callbacks. This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse existing runtime PM logics.

---
Tested on SK-AM62Px with audio playback during system suspend/resume cycles

Testlog:

   https://gist.github.com/SenWang125/065c2840071f2569a79db9e99010603f
  sound/soc/ti/davinci-mcasp.c | 2 ++
  1 file changed, 2 insertions(+)
sound/soc/ti/davinci-mcasp.c +0 -0
index 8a2977093df1..643661ebee83 100644

sound/soc/ti/davinci-mcasp.c static int davinci_mcasp_runtime_resume(struct device *dev) · line 2818

Quoted 8 lines
sound/soc/ti/davinci-mcasp.c +2 -0
@@ -2811,6 +2811,8 @@ static int davinci_mcasp_runtime_resume(struct device *dev)
  #endif
 
  static const struct dev_pm_ops davinci_mcasp_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
  	SET_RUNTIME_PM_OPS(davinci_mcasp_runtime_suspend,
  			   davinci_mcasp_runtime_resume,
  			   NULL)

Tested on j784s4.
Logs: https://gist.github.com/Jamm02/8ed69ad1c9b3a4f0cda4977cc18e01b8

Regards,
Moteen

maintainer
#5 lore raw
In reply to Sen Wang
Quoted 8 lines · Sen Wang

The McASP driver supports runtime PM callbacks for register save/restore during device idle, but doesn't provide system suspend/resume callbacks. This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse existing runtime PM logics.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: ti: davinci-mcasp: Add system suspend/resume support

      commit: 5879521cb558871472b97c4744dbe634a4286f0e

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark