Commit 1d69c5c5 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: core: Add flag to ignore pmdown_time at pcm_close

With this flag codec drivers can indicate that it is desired
to ignore the pmdown_time for DAPM shutdown sequence when
playback stream is stopped.
The DAPM sequence will be executed without delay in this case.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 7a0e67b6
...@@ -578,6 +578,7 @@ struct snd_soc_codec { ...@@ -578,6 +578,7 @@ struct snd_soc_codec {
/* dapm */ /* dapm */
struct snd_soc_dapm_context dapm; struct snd_soc_dapm_context dapm;
unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_codec_root; struct dentry *debugfs_codec_root;
......
...@@ -319,10 +319,17 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) ...@@ -319,10 +319,17 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
cpu_dai->runtime = NULL; cpu_dai->runtime = NULL;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
/* start delayed pop wq here for playback streams */ if (unlikely(codec->ignore_pmdown_time)) {
codec_dai->pop_wait = 1; /* powered down playback stream now */
schedule_delayed_work(&rtd->delayed_work, snd_soc_dapm_stream_event(rtd,
msecs_to_jiffies(rtd->pmdown_time)); codec_dai->driver->playback.stream_name,
SND_SOC_DAPM_STREAM_STOP);
} else {
/* start delayed pop wq here for playback streams */
codec_dai->pop_wait = 1;
schedule_delayed_work(&rtd->delayed_work,
msecs_to_jiffies(rtd->pmdown_time));
}
} else { } else {
/* capture streams can be powered down now */ /* capture streams can be powered down now */
snd_soc_dapm_stream_event(rtd, snd_soc_dapm_stream_event(rtd,
......
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