Commit 96dd3622 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 3a66d387
...@@ -521,6 +521,8 @@ struct snd_soc_card { ...@@ -521,6 +521,8 @@ struct snd_soc_card {
int (*set_bias_level)(struct snd_soc_card *, int (*set_bias_level)(struct snd_soc_card *,
enum snd_soc_bias_level level); enum snd_soc_bias_level level);
int pmdown_time;
/* CPU <--> Codec DAI links */ /* CPU <--> Codec DAI links */
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
int num_links; int num_links;
......
...@@ -542,7 +542,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream) ...@@ -542,7 +542,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
/* start delayed pop wq here for playback streams */ /* start delayed pop wq here for playback streams */
codec_dai->pop_wait = 1; codec_dai->pop_wait = 1;
schedule_delayed_work(&card->delayed_work, schedule_delayed_work(&card->delayed_work,
msecs_to_jiffies(pmdown_time)); msecs_to_jiffies(card->pmdown_time));
} else { } else {
/* capture streams can be powered down now */ /* capture streams can be powered down now */
snd_soc_dapm_stream_event(codec, snd_soc_dapm_stream_event(codec,
...@@ -1039,6 +1039,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1039,6 +1039,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
dev_dbg(card->dev, "All components present, instantiating\n"); dev_dbg(card->dev, "All components present, instantiating\n");
/* Found everything, bring it up */ /* Found everything, bring it up */
card->pmdown_time = pmdown_time;
if (card->probe) { if (card->probe) {
ret = card->probe(pdev); ret = card->probe(pdev);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment