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

Commit 6a2817c7 authored by Aravind Kumar's avatar Aravind Kumar
Browse files

ASoC: msm8x16-wcd: reset pa select after ear pa disable



Current code resets the pa select from ear to hph
before ear pa is disabled. By disabling the ear pa first
and then resetting the pa select bit reduces the
ear turn off pop to 0.45uV.

CRs-Fixed: 643991
Change-Id: I5ca10ce7aca5ef07c8266fde93ef06ef809f81e9
Signed-off-by: default avatarAravind Kumar <akumark@codeaurora.org>
parent fd7ab9da
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2671,11 +2671,17 @@ static int msm8x16_wcd_codec_enable_ear_pa(struct snd_soc_dapm_widget *w,
		break;
	case SND_SOC_DAPM_POST_PMD:
		dev_dbg(w->codec->dev,
			"%s: Sleeping 20ms after disabling EAR PA\n",
			"%s: Sleeping 7ms after disabling EAR PA\n",
			__func__);
		snd_soc_update_bits(codec, MSM8X16_WCD_A_ANALOG_RX_EAR_CTL,
			    0xC0, 0x00);
			    0x40, 0x00);
		usleep_range(7000, 7100);
		/*
		 * Reset pa select bit from ear to hph after ear pa
		 * is disabled to reduce ear turn off pop
		 */
		snd_soc_update_bits(codec, MSM8X16_WCD_A_ANALOG_RX_EAR_CTL,
			    0x80, 0x00);
		break;
	}
	return 0;
@@ -2685,8 +2691,8 @@ static const struct snd_soc_dapm_widget msm8x16_wcd_dapm_widgets[] = {
	/*RX stuff */
	SND_SOC_DAPM_OUTPUT("EAR"),

	SND_SOC_DAPM_PGA_E("EAR PA", MSM8X16_WCD_A_ANALOG_RX_EAR_CTL,
			7, 0, NULL, 0, msm8x16_wcd_codec_enable_ear_pa,
	SND_SOC_DAPM_PGA_E("EAR PA", SND_SOC_NOPM,
			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,