diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-06 10:44:07 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-08 06:08:44 -0500 |
commit | da18396f949ecaa45007d3aeb1b81bd6da092811 (patch) | |
tree | b55566ec8ecc2ecd42a1caec23310e41b24ebfb9 /sound/soc/soc-pcm.c | |
parent | e38b9b7478d57701fbcbaafdde169aa1a88d0eca (diff) |
ASoC: core: Allow digital mute for capture
Help avoid noise from the power up of the capture path propagating through
into the start of the recording (especially noise caused by the ramp of
microphone biases) by keeping the capture muted until after we've finished
powering things up with DAPM in the same manner we do for playback. This
allows us to take advantage of soft mute support in the hardware more
effectively and is more consistent.
The core code using the existing digital mute operation is updated to take
advantage of this. Some additional cases in the soc-pcm code and suspend
will need separate handling but these are less practically relevant than
the main runtime stream start/stop case.
Rather than refactor the digital mute function in every single driver a
new operation is added for drivers taking advantage of this functionality,
the old operation should be phased out over time.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index cf191e6aebbe..d675b4ae0df6 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -383,8 +383,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) | |||
383 | /* Muting the DAC suppresses artifacts caused during digital | 383 | /* Muting the DAC suppresses artifacts caused during digital |
384 | * shutdown, for example from stopping clocks. | 384 | * shutdown, for example from stopping clocks. |
385 | */ | 385 | */ |
386 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 386 | snd_soc_dai_digital_mute(codec_dai, 1, substream->stream); |
387 | snd_soc_dai_digital_mute(codec_dai, 1); | ||
388 | 387 | ||
389 | if (cpu_dai->driver->ops->shutdown) | 388 | if (cpu_dai->driver->ops->shutdown) |
390 | cpu_dai->driver->ops->shutdown(substream, cpu_dai); | 389 | cpu_dai->driver->ops->shutdown(substream, cpu_dai); |
@@ -488,7 +487,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
488 | snd_soc_dapm_stream_event(rtd, substream->stream, | 487 | snd_soc_dapm_stream_event(rtd, substream->stream, |
489 | SND_SOC_DAPM_STREAM_START); | 488 | SND_SOC_DAPM_STREAM_START); |
490 | 489 | ||
491 | snd_soc_dai_digital_mute(codec_dai, 0); | 490 | snd_soc_dai_digital_mute(codec_dai, 0, substream->stream); |
492 | 491 | ||
493 | out: | 492 | out: |
494 | mutex_unlock(&rtd->pcm_mutex); | 493 | mutex_unlock(&rtd->pcm_mutex); |
@@ -586,7 +585,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) | |||
586 | 585 | ||
587 | /* apply codec digital mute */ | 586 | /* apply codec digital mute */ |
588 | if (!codec->active) | 587 | if (!codec->active) |
589 | snd_soc_dai_digital_mute(codec_dai, 1); | 588 | snd_soc_dai_digital_mute(codec_dai, 1, substream->stream); |
590 | 589 | ||
591 | /* free any machine hw params */ | 590 | /* free any machine hw params */ |
592 | if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free) | 591 | if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free) |