ASoC: wcd9310: Turn on EAR DAC and PA at the same time.

Turn on EAR DAC and EAR PA at the same time to avoid pop
at start of playback.

CRs-Fixed: 386288
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
(cherry picked from commit 7c85d71830e1781c113cf1d69234169e8feb31c9)
(cherry picked from commit deb584f6a8788dcda97a9d83038103ebd2576771)

Change-Id: Ib50f6a488fe93595423bae30164073cc25b90076
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
This commit is contained in:
Damir Didjusto 2012-08-16 21:22:29 -07:00 committed by Stephen Boyd
parent afa047d5e4
commit 9f7844b097

View file

@ -1794,11 +1794,11 @@ static void tabla_codec_enable_bandgap(struct snd_soc_codec *codec,
0x00);
} else if ((tabla->bandgap_type == TABLA_BANDGAP_MBHC_MODE) &&
(choice == TABLA_BANDGAP_AUDIO_MODE)) {
snd_soc_write(codec, TABLA_A_BIAS_CENTRAL_BG_CTL, 0x00);
snd_soc_write(codec, TABLA_A_BIAS_CENTRAL_BG_CTL, 0x50);
usleep_range(100, 100);
tabla_codec_enable_audio_mode_bandgap(codec);
} else if (choice == TABLA_BANDGAP_OFF) {
snd_soc_write(codec, TABLA_A_BIAS_CENTRAL_BG_CTL, 0x00);
snd_soc_write(codec, TABLA_A_BIAS_CENTRAL_BG_CTL, 0x50);
} else {
pr_err("%s: Error, Invalid bandgap settings\n", __func__);
}
@ -3065,6 +3065,26 @@ static int tabla_lineout_dac_event(struct snd_soc_dapm_widget *w,
return 0;
}
static int tabla_ear_pa_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_codec *codec = w->codec;
pr_debug("%s %d\n", __func__, event);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
snd_soc_update_bits(codec, TABLA_A_RX_EAR_EN, 0x50, 0x50);
break;
case SND_SOC_DAPM_PRE_PMD:
snd_soc_update_bits(codec, TABLA_A_RX_EAR_EN, 0x10, 0x00);
snd_soc_update_bits(codec, TABLA_A_RX_EAR_EN, 0x40, 0x00);
break;
}
return 0;
}
static const struct snd_soc_dapm_widget tabla_1_x_dapm_widgets[] = {
SND_SOC_DAPM_MICBIAS_E("MIC BIAS4 External", TABLA_1_A_MICB_4_CTL, 7,
0, tabla_codec_enable_micbias,
@ -4700,9 +4720,11 @@ static const struct snd_soc_dapm_widget tabla_dapm_widgets[] = {
/*RX stuff */
SND_SOC_DAPM_OUTPUT("EAR"),
SND_SOC_DAPM_PGA("EAR PA", TABLA_A_RX_EAR_EN, 4, 0, NULL, 0),
SND_SOC_DAPM_PGA_E("EAR PA", SND_SOC_NOPM, 0, 0, NULL,
0, tabla_ear_pa_event, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_PRE_PMD),
SND_SOC_DAPM_MIXER("DAC1", TABLA_A_RX_EAR_EN, 6, 0, dac1_switch,
SND_SOC_DAPM_MIXER("DAC1", SND_SOC_NOPM, 0, 0, dac1_switch,
ARRAY_SIZE(dac1_switch)),
/* Headphone */