From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: tiwai@suse.de, vinod.koul@linux.intel.com,
patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
liam.r.girdwood@intel.com
Subject: [PATCH v5] ASoC: soc-compress: Cancel delayed power down if needed
Date: Fri, 22 Mar 2013 08:50:40 +0000 [thread overview]
Message-ID: <20130322085040.GE2141@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20130320102544.GK28775@opensource.wolfsonmicro.com>
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>
---
Sorry I somehow managed to send v3 again as v4, not quite sure
how that came about.
Charles
sound/soc/soc-compress.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index b5b3db7..9eb8b4a 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -198,8 +198,10 @@ 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);
/* first we call set_params for the platform driver
@@ -211,19 +213,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;
}
--
1.7.2.5
next prev parent reply other threads:[~2013-03-22 8:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Charles Keepax [this message]
2013-03-26 17:51 ` [PATCH v5] " Mark Brown
2013-03-27 11:41 ` Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130322085040.GE2141@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=liam.r.girdwood@intel.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=tiwai@suse.de \
--cc=vinod.koul@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).