[alsa-devel] [PATCH v2] ASoC: soc-compress: Cancel delayed power down if needed

Charles Keepax ckeepax at opensource.wolfsonmicro.com
Fri Jan 25 17:56:28 CET 2013


When a new stream is being opened it is necessary to cancel any delayed
power down of the audio.

Signed-off-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
---

Apologies the last version was incorrectly generated from the
wrong tree and used codec_dai instead of rtd for the pop_wait.


 sound/soc/soc-compress.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index f9fb112..a3cc6f7 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -216,6 +216,12 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
 			goto out;
 	}
 
+	/* cancel any delayed stream shutdown that is pending */
+	if (rtd->pop_wait) {
+		rtd->pop_wait = 0;
+		cancel_delayed_work(&rtd->delayed_work);
+	}
+
 	snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK,
 				SND_SOC_DAPM_STREAM_START);
 
-- 
1.7.2.5



More information about the Alsa-devel mailing list