Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120177
b: refs/heads/master
c: d45f621
h: refs/heads/master
i:
  120175: 53cdfda
v: v3
  • Loading branch information
Mark Brown authored and Mark Brown committed Oct 30, 2008
1 parent d14c830 commit 163d3fa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12ef193d5817504621e503e78d641265f6a86ac4
refs/heads/master: d45f6219d256b4e02f9ebee2e3911f4ea80bac70
55 changes: 23 additions & 32 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,51 +429,42 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
}
}

/* we only want to start a DAPM playback stream if we are not waiting
* on an existing one stopping */
if (codec_dai->pop_wait) {
/* we are waiting for the delayed work to start */
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
snd_soc_dapm_stream_event(socdev->codec,
codec_dai->capture.stream_name,
SND_SOC_DAPM_STREAM_START);
else {
codec_dai->pop_wait = 0;
cancel_delayed_work(&socdev->delayed_work);
snd_soc_dai_digital_mute(codec_dai, 0);
}
} else {
/* no delayed work - do we need to power up codec */
if (codec->bias_level != SND_SOC_BIAS_ON) {
/* cancel any delayed stream shutdown that is pending */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
codec_dai->pop_wait) {
codec_dai->pop_wait = 0;
cancel_delayed_work(&socdev->delayed_work);
}

snd_soc_dapm_set_bias_level(socdev,
SND_SOC_BIAS_PREPARE);
/* do we need to power up codec */
if (codec->bias_level != SND_SOC_BIAS_ON) {
snd_soc_dapm_set_bias_level(socdev,
SND_SOC_BIAS_PREPARE);

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_soc_dapm_stream_event(codec,
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_soc_dapm_stream_event(codec,
codec_dai->playback.stream_name,
SND_SOC_DAPM_STREAM_START);
else
snd_soc_dapm_stream_event(codec,
else
snd_soc_dapm_stream_event(codec,
codec_dai->capture.stream_name,
SND_SOC_DAPM_STREAM_START);

snd_soc_dapm_set_bias_level(socdev, SND_SOC_BIAS_ON);
snd_soc_dai_digital_mute(codec_dai, 0);
snd_soc_dapm_set_bias_level(socdev, SND_SOC_BIAS_ON);
snd_soc_dai_digital_mute(codec_dai, 0);

} else {
/* codec already powered - power on widgets */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_soc_dapm_stream_event(codec,
} else {
/* codec already powered - power on widgets */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_soc_dapm_stream_event(codec,
codec_dai->playback.stream_name,
SND_SOC_DAPM_STREAM_START);
else
snd_soc_dapm_stream_event(codec,
else
snd_soc_dapm_stream_event(codec,
codec_dai->capture.stream_name,
SND_SOC_DAPM_STREAM_START);

snd_soc_dai_digital_mute(codec_dai, 0);
}
snd_soc_dai_digital_mute(codec_dai, 0);
}

out:
Expand Down

0 comments on commit 163d3fa

Please sign in to comment.