Skip to contentSkip to conversation

ASoC: pcm: If pmdown_time is zero then shut down DAPM immediately

PATCH In review Mark Brown 2 participants 2 messages Feb 8, 2012 – Feb 9, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: pcm: If pmdown_time is zero then shut down DAPM immediately

Since we've already got logic to special case immediate teardown of the stream we may as well use it if the pmdown_time has been set to zero by the application layer instead of scheduling a work item with zero delay.

---
 sound/soc/soc-pcm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/soc-pcm.c +1 -1
index ef28dd5..d7bb268 100644
@@ -369,7 +369,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
 	cpu_dai->runtime = NULL;
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		if (codec->ignore_pmdown_time ||
+		if (!rtd->pmdown_time || codec->ignore_pmdown_time ||
 		    rtd->dai_link->ignore_pmdown_time) {
 			/* powered down playback stream now */
 			snd_soc_dapm_stream_event(rtd,
Signature · 1 line
1.7.9.rc1
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Mark Brown

Since we've already got logic to special case immediate teardown of the stream we may as well use it if the pmdown_time has been set to zero by the application layer instead of scheduling a work item with zero delay.

---
 sound/soc/soc-pcm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/soc-pcm.c +0 -0
index ef28dd5..d7bb268 100644

sound/soc/soc-pcm.c static int soc_pcm_close(struct snd_pcm_substream *substream) · line 375

Quoted 8 lines
sound/soc/soc-pcm.c +1 -1
@@ -369,7 +369,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
 	cpu_dai->runtime = NULL;
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		if (codec->ignore_pmdown_time ||
+		if (!rtd->pmdown_time || codec->ignore_pmdown_time ||
 		    rtd->dai_link->ignore_pmdown_time) {
 			/* powered down playback stream now */
 			snd_soc_dapm_stream_event(rtd,