Skip to contentSkip to conversation

ASoC: Tegra: Suspend/resume support

PATCH Superseded Stephen Warren 2 participants 2 messages Apr 5, 2011 1 message not in the archive

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Tegra: Suspend/resume support

ASoC machine drivers that are their own platform_driver (as opposed to those using the soc-audio platform_driver) need to explicitly set up power-management operation callbacks.

---
Note: This has been tested in the ChromeOS-2.6.37 kernel, with a backport of ASoC for-2.6.39, on Seaboard. I have not tested it in mainline (I'm not sure whether mainline has PM support for the Tegra platform yet), although I did at least compile-test it.

 sound/soc/tegra/harmony.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
sound/soc/tegra/harmony.c +7 -0
index 8585957..a67d521 100644
@@ -366,10 +366,17 @@ static int __devexit tegra_snd_harmony_remove(struct platform_device *pdev)
 	return 0;
 }
 
+const struct dev_pm_ops harmony_pm_ops = {
+	.suspend = snd_soc_suspend,
+	.resume = snd_soc_resume,
+	.poweroff = snd_soc_poweroff,
+};
+
 static struct platform_driver tegra_snd_harmony_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.owner = THIS_MODULE,
+		.pm = &harmony_pm_ops,
 	},
 	.probe = tegra_snd_harmony_probe,
 	.remove = __devexit_p(tegra_snd_harmony_remove),
Signature · 1 line
1.7.1
#2 lore raw
In reply to a message not in the archive

sound/soc/tegra/harmony.c static int __devexit tegra_snd_harmony_remove(struct platform_device *pdev) · line 373

Quoted 5 lines · Stephen Warren
sound/soc/tegra/harmony.c +5 -0
+const struct dev_pm_ops harmony_pm_ops = {
+	.suspend = snd_soc_suspend,
+	.resume = snd_soc_resume,
+	.poweroff = snd_soc_poweroff,
+};

We should add an export for snd_soc_pm_ops too so that drivers like this that can just use the default behaviour don't need to cut'n'paste the code like this.