All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>
Subject: [PATCH] ASoC: Intel: Add support for PM ops in bxt-da7219_max98357a
Date: Fri, 17 Jun 2016 10:03:30 +0530	[thread overview]
Message-ID: <1466138010-27740-1-git-send-email-vinod.koul@intel.com> (raw)

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

             reply	other threads:[~2016-06-17  4:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  4:33 Vinod Koul [this message]
2016-06-17 11:14 ` [PATCH] ASoC: Intel: Add support for PM ops in bxt-da7219_max98357a 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466138010-27740-1-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.