Skip to contentSkip to conversation

Enable runtime PM for SOF device

PATCH In review Daniel Baluta 2 participants 4 messages Sep 24, 2020 – Sep 25, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Enable runtime PM for SOF device

From: Daniel Baluta <[email protected]>

This enables runtime PM for SOF device. Next patchseries will provide PM suspend/resume handlers for i.MX8 specific devices.

Daniel Baluta (2):
ASoC: SOF: Activate runtime PM with SOF OF device
ASoC: SOF: Add .prepare/.complete callbacks

 sound/soc/sof/sof-of-dev.c | 6 ++++++
 1 file changed, 6 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 ASoC: SOF: Activate runtime PM with SOF OF device

From: Daniel Baluta <[email protected]>

SOF boots the DSP at probe and keeps it up all the time. With this change, after booting if no one is using the DSP the SOF core will turn off the DSP to save power.

---
 sound/soc/sof/sof-of-dev.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/soc/sof/sof-of-dev.c +4 -0
index f492c5dfa659..de9acc0e33cb 100644
@@ -56,7 +56,11 @@ static void sof_of_probe_complete(struct device *dev)
 	/* allow runtime_pm */
 	pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS);
 	pm_runtime_use_autosuspend(dev);
+	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
+
+	pm_runtime_mark_last_busy(dev);
+	pm_runtime_put_autosuspend(dev);
 }
 
 static int sof_of_probe(struct platform_device *pdev)
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 ASoC: SOF: Add .prepare/.complete callbacks

In reply to Daniel Baluta

From: Daniel Baluta <[email protected]>

Use SOF defined callbacks (snd_sof_prepare/snd_sof_complete) in order to update internal SOF system suspend target.

---
 sound/soc/sof/sof-of-dev.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/sof/sof-of-dev.c +2 -0
index de9acc0e33cb..85ff0db88eb7 100644
@@ -46,6 +46,8 @@ static struct sof_dev_desc sof_of_imx8mp_desc = {
 #endif
 
 static const struct dev_pm_ops sof_of_pm = {
+	.prepare = snd_sof_prepare,
+	.complete = snd_sof_complete,
 	SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
 	SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
 			   NULL)
Signature · 1 line
2.17.1
maintainer
#3 lore raw
In reply to Daniel Baluta
Quoted 8 lines · Daniel Baluta

This enables runtime PM for SOF device. Next patchseries will provide PM suspend/resume handlers for i.MX8 specific devices.

Daniel Baluta (2):
ASoC: SOF: Activate runtime PM with SOF OF device
ASoC: SOF: Add .prepare/.complete callbacks

[...]

Applied to

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

Thanks!

[1/2] ASoC: SOF: Activate runtime PM with SOF OF device

      commit: 4fefc39894d8975d58b02b4b5f635d20891778ca
[2/2] ASoC: SOF: Add .prepare/.complete callbacks
      commit: dd759805d6f78262cb9aa63ef37e3bc263ef1978

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