ASoC: Make pmdown_time a per-card setting

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, March 1, 2010 - 11:01 am

Gitweb:     http://git.kernel.org/linus/96dd362284ddcb546d2783035ae7eeda73692eda
Commit:     96dd362284ddcb546d2783035ae7eeda73692eda
Parent:     3a66d3877eaa4ab9818000a15c07326adaa9ca79
Author:     Mark Brown <broonie@opensource.wolfsonmicro.com>
AuthorDate: Fri Feb 12 11:05:44 2010 +0000
Committer:  Mark Brown <broonie@opensource.wolfsonmicro.com>
CommitDate: Tue Feb 16 19:14:52 2010 +0000

    ASoC: Make pmdown_time a per-card setting
    
    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>
    Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
---
 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)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ASoC: Make pmdown_time a per-card setting, Linux Kernel Mailing ..., (Mon Mar 1, 11:01 am)