alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-compress: Cancel delayed power down if needed
@ 2013-01-25 15:38 Charles Keepax
  2013-01-25 16:56 ` [PATCH v2] " Charles Keepax
  2013-01-26  8:52 ` [PATCH] " Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Charles Keepax @ 2013-01-25 15:38 UTC (permalink / raw)
  To: broonie
  Cc: vinod.koul, tiwai, patches, alsa-devel, liam.r.girdwood,
	Charles Keepax

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@opensource.wolfsonmicro.com>
---
 sound/soc/soc-compress.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index f9fb112..eb8191b 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -194,6 +194,7 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
 {
 	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
 	struct snd_soc_platform *platform = rtd->platform;
+	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	int ret = 0;
 
 	mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
@@ -216,6 +217,12 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
 			goto out;
 	}
 
+	/* cancel any delayed stream shutdown that is pending */
+	if (codec_dai->pop_wait) {
+		codec_dai->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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-27 11:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 15:38 [PATCH] ASoC: soc-compress: Cancel delayed power down if needed Charles Keepax
2013-01-25 16:56 ` [PATCH v2] " Charles Keepax
2013-01-26  8:52 ` [PATCH] " Mark Brown
2013-03-08 16:52   ` [PATCH v3] " Charles Keepax
2013-03-11  9:25     ` [PATCH v4] " Charles Keepax
2013-03-20 10:25       ` Mark Brown
2013-03-22  8:50         ` [PATCH v5] " Charles Keepax
2013-03-26 17:51           ` Mark Brown
2013-03-27 11:41             ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).