alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Tegra: Suspend/resume support
@ 2011-04-05 20:27 Stephen Warren
       [not found] ` <1302035256-26301-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2011-04-05 20:27 UTC (permalink / raw)
  To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	lrg-kDsPt+C1G03kYMGBc/C6ZA
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

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.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
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(-)

diff --git a/sound/soc/tegra/harmony.c b/sound/soc/tegra/harmony.c
index 8585957..a67d521 100644
--- a/sound/soc/tegra/harmony.c
+++ b/sound/soc/tegra/harmony.c
@@ -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),
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: Tegra: Suspend/resume support
       [not found] ` <1302035256-26301-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-04-05 23:14   ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2011-04-05 23:14 UTC (permalink / raw)
  To: Stephen Warren
  Cc: lrg-kDsPt+C1G03kYMGBc/C6ZA, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Tue, Apr 05, 2011 at 02:27:36PM -0600, Stephen Warren wrote:

> +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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-05 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 20:27 [PATCH] ASoC: Tegra: Suspend/resume support Stephen Warren
     [not found] ` <1302035256-26301-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-04-05 23:14   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).