alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Grazvydas Ignotas <notasas@gmail.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH 1/2] ASoC: Make pmdown_time a per-card setting
Date: Fri, 12 Feb 2010 11:40:18 +0000	[thread overview]
Message-ID: <1265974819-25151-1-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)

Make the pmdown_time a per-card setting rather than a global one,
initialised before the card initialisation runs. This allows cards
to override the default setting if it makes sense to do so (for
example, due to an unavoidable pop).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/sound/soc.h  |    2 ++
 sound/soc/soc-core.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index e6a6d10..d9d88dd 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -521,6 +521,8 @@ struct snd_soc_card {
 	int (*set_bias_level)(struct snd_soc_card *,
 			      enum snd_soc_bias_level level);
 
+	int pmdown_time;
+
 	/* CPU <--> Codec DAI links  */
 	struct snd_soc_dai_link *dai_link;
 	int num_links;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ca89c78..94b9cde 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -542,7 +542,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
 		/* start delayed pop wq here for playback streams */
 		codec_dai->pop_wait = 1;
 		schedule_delayed_work(&card->delayed_work,
-			msecs_to_jiffies(pmdown_time));
+			msecs_to_jiffies(card->pmdown_time));
 	} else {
 		/* capture streams can be powered down now */
 		snd_soc_dapm_stream_event(codec,
@@ -1039,6 +1039,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
 	dev_dbg(card->dev, "All components present, instantiating\n");
 
 	/* Found everything, bring it up */
+	card->pmdown_time = pmdown_time;
+
 	if (card->probe) {
 		ret = card->probe(pdev);
 		if (ret < 0)
-- 
1.6.6.1

             reply	other threads:[~2010-02-12 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12 11:40 Mark Brown [this message]
2010-02-12 11:40 ` [PATCH 2/2] ASoC: Make pmdown_time runtime configurable Mark Brown
2010-02-12 14:22   ` Liam Girdwood
2010-02-13 14:46   ` Grazvydas Ignotas
2010-02-12 14:19 ` [PATCH 1/2] ASoC: Make pmdown_time a per-card setting Liam Girdwood

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=1265974819-25151-1-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=notasas@gmail.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 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).