diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-06 15:44:07 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-08 11:08:44 +0000 |
commit | da18396f949ecaa45007d3aeb1b81bd6da092811 (patch) | |
tree | b55566ec8ecc2ecd42a1caec23310e41b24ebfb9 /sound/soc/soc-compress.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-compress.c')
-rw-r--r-- | sound/soc/soc-compress.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index 35726cbf1f02..b5b3db71e253 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -116,12 +116,13 @@ static int soc_compr_free(struct snd_compr_stream *cstream) if (cstream->direction == SND_COMPRESS_PLAYBACK) { cpu_dai->playback_active--; codec_dai->playback_active--; - snd_soc_dai_digital_mute(codec_dai, 1); } else { cpu_dai->capture_active--; codec_dai->capture_active--; } + snd_soc_dai_digital_mute(codec_dai, 1, cstream->direction); + cpu_dai->active--; codec_dai->active--; codec->active--; @@ -178,15 +179,13 @@ static int soc_compr_trigger(struct snd_compr_stream *cstream, int cmd) goto out; } - if (cstream->direction == SND_COMPRESS_PLAYBACK) { - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - snd_soc_dai_digital_mute(codec_dai, 0); - break; - case SNDRV_PCM_TRIGGER_STOP: - snd_soc_dai_digital_mute(codec_dai, 1); - break; - } + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + snd_soc_dai_digital_mute(codec_dai, 0, cstream->direction); + break; + case SNDRV_PCM_TRIGGER_STOP: + snd_soc_dai_digital_mute(codec_dai, 1, cstream->direction); + break; } out: |