aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-06 10:44:07 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-08 06:08:44 -0500
commitda18396f949ecaa45007d3aeb1b81bd6da092811 (patch)
treeb55566ec8ecc2ecd42a1caec23310e41b24ebfb9 /sound/soc/soc-core.c
parente38b9b7478d57701fbcbaafdde169aa1a88d0eca (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-core.c')
-rw-r--r--sound/soc/soc-core.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2370063b5824..4eac22797893 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3540,12 +3540,20 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tristate);
3540 * snd_soc_dai_digital_mute - configure DAI system or master clock. 3540 * snd_soc_dai_digital_mute - configure DAI system or master clock.
3541 * @dai: DAI 3541 * @dai: DAI
3542 * @mute: mute enable 3542 * @mute: mute enable
3543 * @direction: stream to mute
3543 * 3544 *
3544 * Mutes the DAI DAC. 3545 * Mutes the DAI DAC.
3545 */ 3546 */
3546int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute) 3547int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
3548 int direction)
3547{ 3549{
3548 if (dai->driver && dai->driver->ops->digital_mute) 3550 if (!dai->driver)
3551 return -ENOTSUPP;
3552
3553 if (dai->driver->ops->mute_stream)
3554 return dai->driver->ops->mute_stream(dai, mute, direction);
3555 else if (direction == SNDRV_PCM_STREAM_PLAYBACK &&
3556 dai->driver->ops->digital_mute)
3549 return dai->driver->ops->digital_mute(dai, mute); 3557 return dai->driver->ops->digital_mute(dai, mute);
3550 else 3558 else
3551 return -ENOTSUPP; 3559 return -ENOTSUPP;