Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd9dd802 authored by Aravind Kumar's avatar Aravind Kumar
Browse files

ASoC: msm8x16-wcd: fix no audio in ear during first call



During boot up the gain of ear pa is set to 6 dB by
setting bit 5 of register 0x19E. When the first MO voice
call is done, the ear_s switch is attempted to be activated.
However, since this also attempts to set the same bit
which is already set during boot up, dapm does not power
up this switch. This results in the ear rx path not
being set up.

Change the ear_s switch to a virtual mux so that the
setting up of the ear_s switch does not depend on the
value of the register associated with it.

Change-Id: I3b0a8baafca098e2265bc753b5bb6e044737b538
Signed-off-by: default avatarAravind Kumar <akumark@codeaurora.org>
parent 12b56fe9
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1526,9 +1526,15 @@ static const struct snd_kcontrol_new rdac2_mux =
static const struct snd_kcontrol_new iir1_inp1_mux =
	SOC_DAPM_ENUM("IIR1 INP1 Mux", iir1_inp1_mux_enum);

static const struct snd_kcontrol_new ear_pa_switch[] = {
	SOC_DAPM_SINGLE("Switch",
		MSM8X16_WCD_A_ANALOG_RX_EAR_CTL, 5, 1, 0)
static const char * const ear_text[] = {
	"ZERO", "Switch",
};

static const struct soc_enum ear_enum =
	SOC_ENUM_SINGLE(0, 0, ARRAY_SIZE(ear_text), ear_text);

static const struct snd_kcontrol_new ear_pa_mux[] = {
	SOC_DAPM_ENUM_VIRT("EAR_S", ear_enum)
};

static const char * const hph_text[] = {
@@ -2825,8 +2831,8 @@ static const struct snd_soc_dapm_widget msm8x16_wcd_dapm_widgets[] = {
			0, 0, NULL, 0, msm8x16_wcd_codec_enable_ear_pa,
			SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
			SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
	SND_SOC_DAPM_MIXER("EAR_S", SND_SOC_NOPM, 0, 0,
		ear_pa_switch, ARRAY_SIZE(ear_pa_switch)),
	SND_SOC_DAPM_VIRT_MUX("EAR_S", SND_SOC_NOPM, 0, 0,
		ear_pa_mux),

	SND_SOC_DAPM_AIF_IN("I2S RX1", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),