diff options
author | venkappa mala <venkappa.m@samsung.com> | 2011-10-04 19:02:07 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-10-13 00:16:08 -0700 |
commit | d29be5ecd1b75cf74bbbec852ae9ae49a62f2c8b (patch) | |
tree | aafc152c546199d243e3b800d8dffb4ca2fc754e /sound | |
parent | 26202f8be38d06eb6c6395ca1b164a67a0ae85bf (diff) | |
download | kernel_samsung_tuna-d29be5ecd1b75cf74bbbec852ae9ae49a62f2c8b.zip kernel_samsung_tuna-d29be5ecd1b75cf74bbbec852ae9ae49a62f2c8b.tar.gz kernel_samsung_tuna-d29be5ecd1b75cf74bbbec852ae9ae49a62f2c8b.tar.bz2 |
ASoC: twl6040: The ADC debounce time is moved to twl6040 prepare
The delay is creating pop noises during voicecall when audio path changes.
The issue has been noticed with McPDM prepare which invokes prior TWL6040
ADC turn on. Therefore,the McPDM UL_DATA will be filling some garbage data
to McPDM FIFO before codec ADC stabilization which creates pop noises.
However, the debounce time is still required for ASR audio capture test to
avoid oscillations. The conclusion, the codec start-up sequence is moved
to twl6040 prepare to ensure that the codec ADC should be turn on before
McPDM UL_DATA FIFO up for audio capture.
Change-Id: I7ca791a9bab22d469801ec50c8de4724759950b7
Signed-off-by: venkappa mala <venkappa.m@samsung.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/twl6040.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 0ef82f2..0563466 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -813,13 +813,6 @@ static int twl6040_hs_dac_event(struct snd_soc_dapm_widget *w, return 0; } -static int twl6040_micbias_event(struct snd_soc_dapm_widget *w, - struct snd_kcontrol *kcontrol, int event) -{ - msleep(150); - return 0; -} - static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { @@ -1227,12 +1220,11 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { TWL6040_REG_MICRCTL, 1, 0, NULL, 0), /* ADCs */ - SND_SOC_DAPM_ADC_E("ADC Left", "Left Front Capture", - TWL6040_REG_MICLCTL, 2, 0, twl6040_micbias_event, - SND_SOC_DAPM_POST_PMU), - SND_SOC_DAPM_ADC_E("ADC Right", "Right Front Capture", - TWL6040_REG_MICRCTL, 2, 0, twl6040_micbias_event, - SND_SOC_DAPM_POST_PMU), + SND_SOC_DAPM_ADC("ADC Left", "Left Front Capture", + TWL6040_REG_MICLCTL, 2, 0), + SND_SOC_DAPM_ADC("ADC Right", "Right Front Capture", + TWL6040_REG_MICRCTL, 2, 0), + /* Microphone bias */ SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL6040_REG_AMICBCTL, 0, 0), @@ -1527,6 +1519,21 @@ static int twl6040_prepare(struct snd_pcm_substream *substream, priv->sysclk); return -EPERM; } + + /* + * In the capture, the Analog path should be turn on and stabilized + * before McPDM prepare itself to avoid pop noises. + * So the codec startup event is sending through dapm in prepare itself + * to ensure that the codec analog path is up before McPDM Uplink FIFO + * is going to be activated. + */ + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + snd_soc_dapm_codec_stream_event(dai->codec, + dai->driver->capture.stream_name, + SND_SOC_DAPM_STREAM_START); + msleep(150); + } + return 0; } |