All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: Add support for PM ops in bxt-da7219_max98357a
@ 2016-06-17  4:33 Vinod Koul
  2016-06-17 11:14 ` Mark Brown
  2016-06-17 11:18 ` Lars-Peter Clausen
  0 siblings, 2 replies; 11+ messages in thread
From: Vinod Koul @ 2016-06-17  4:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul

We need card to be early suspended and late resumed, so use
prepare and complete for card suspend and resume.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Harsha Priya <harshapriya.n@intel.com>
---
 sound/soc/intel/boards/bxt_da7219_max98357a.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index 3774b117d365..df5f269a9b67 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -441,11 +441,30 @@ static int broxton_audio_probe(struct platform_device *pdev)
 	return devm_snd_soc_register_card(&pdev->dev, &broxton_audio_card);
 }
 
+#ifdef CONFIG_PM_SLEEP
+
+static void broxton_complete(struct device *dev)
+{
+	snd_soc_resume(dev);
+}
+
+#else
+#define broxton_complete NULL
+#endif
+
+static const struct dev_pm_ops broxton_pm_ops = {
+	.prepare = snd_soc_suspend,
+	.complete = broxton_complete,
+	.freeze = snd_soc_suspend,
+	.thaw = snd_soc_resume,
+	.poweroff = snd_soc_poweroff,
+	.restore = snd_soc_resume,
+};
 static struct platform_driver broxton_audio = {
 	.probe = broxton_audio_probe,
 	.driver = {
 		.name = "bxt_da7219_max98357a_i2s",
-		.pm = &snd_soc_pm_ops,
+		.pm = &broxton_pm_ops,
 	},
 };
 module_platform_driver(broxton_audio)
-- 
1.9.1

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

end of thread, other threads:[~2016-06-20 13:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17  4:33 [PATCH] ASoC: Intel: Add support for PM ops in bxt-da7219_max98357a Vinod Koul
2016-06-17 11:14 ` Mark Brown
2016-06-17 12:14   ` Vinod Koul
2016-06-17 12:35     ` Mark Brown
2016-06-20 11:47       ` Vinod Koul
2016-06-17 11:18 ` Lars-Peter Clausen
2016-06-17 12:15   ` Vinod Koul
2016-06-17 12:31     ` Mark Brown
2016-06-20 11:44       ` Vinod Koul
2016-06-20 13:26         ` Mark Brown
2016-06-20 14:02           ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.