diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2013-03-27 16:39:01 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-28 00:23:56 +0000 |
commit | fa40ef208c955bfe21f53913f51f297ac3237e95 (patch) | |
tree | 0b9357803c1bb2742828fd031ab5eba415670dea /sound | |
parent | 8bb9660418e05bb1845ac1a2428444d78e322cc7 (diff) | |
download | linux-fa40ef208c955bfe21f53913f51f297ac3237e95.tar.bz2 |
ASoC: compress: Cancel delayed power down if needed
When a new stream is being opened it is necessary to cancel any delayed
power down of the audio.
[Fixed unused variable -- broonie]
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-compress.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index b5b3db71e253..ed0bfb0ddb96 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -211,19 +211,27 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream, if (platform->driver->compr_ops && platform->driver->compr_ops->set_params) { ret = platform->driver->compr_ops->set_params(cstream, params); if (ret < 0) - goto out; + goto err; } if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->set_params) { ret = rtd->dai_link->compr_ops->set_params(cstream); if (ret < 0) - goto out; + goto err; } snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK, SND_SOC_DAPM_STREAM_START); -out: + /* cancel any delayed stream shutdown that is pending */ + rtd->pop_wait = 0; + mutex_unlock(&rtd->pcm_mutex); + + cancel_delayed_work_sync(&rtd->delayed_work); + + return ret; + +err: mutex_unlock(&rtd->pcm_mutex); return ret; } |