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

Commit 5c099884 authored by Aravind Kumar's avatar Aravind Kumar Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm8x16-wcd: optimise hph pop level in conga



8909 based on conga codec has turn on and turn off
click and pop levels higher than the specification.
Update the enable and disable of ocp bits in the
power up and power down sequence to ensure pop levels
are within the specification.

Change-Id: I41045f38d07723a32948c40ba229f5f17d60c4c0
Signed-off-by: default avatarAravind Kumar <akumark@codeaurora.org>
parent 57fb4f72
Loading
Loading
Loading
Loading
+14 −17
Original line number Diff line number Diff line
@@ -2711,30 +2711,29 @@ static int msm8x16_wcd_hph_pa_event(struct snd_soc_dapm_widget *w,

	switch (event) {
	case SND_SOC_DAPM_PRE_PMU:
		if (w->shift == 5) {
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_L_TEST, 0x04, 0x04);
		if (w->shift == 5)
			msm8x16_notifier_call(codec,
					WCD_EVENT_PRE_HPHL_PA_ON);
		} else if (w->shift == 4) {
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_R_TEST, 0x04, 0x04);
		else if (w->shift == 4)
			msm8x16_notifier_call(codec,
					WCD_EVENT_PRE_HPHR_PA_ON);
		}
		snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_NCP_FBCTRL, 0x20, 0x20);
		break;

	case SND_SOC_DAPM_POST_PMU:
		usleep_range(4000, 4100);
		if (w->shift == 5)
		usleep_range(7000, 7100);
		if (w->shift == 5) {
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_L_TEST, 0x04, 0x04);
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_CDC_RX1_B6_CTL, 0x01, 0x00);
		else if (w->shift == 4)
		} else if (w->shift == 4) {
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_R_TEST, 0x04, 0x04);
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_CDC_RX2_B6_CTL, 0x01, 0x00);
		usleep_range(10000, 10100);
		}
		break;

	case SND_SOC_DAPM_PRE_PMD:
@@ -2742,11 +2741,15 @@ static int msm8x16_wcd_hph_pa_event(struct snd_soc_dapm_widget *w,
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_CDC_RX1_B6_CTL, 0x01, 0x01);
			msleep(20);
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_L_TEST, 0x04, 0x00);
			msm8x16_wcd->mute_mask |= HPHL_PA_DISABLE;
		} else if (w->shift == 4) {
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_CDC_RX2_B6_CTL, 0x01, 0x01);
			msleep(20);
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_R_TEST, 0x04, 0x00);
			msm8x16_wcd->mute_mask |= HPHR_PA_DISABLE;
		}
		break;
@@ -2754,17 +2757,11 @@ static int msm8x16_wcd_hph_pa_event(struct snd_soc_dapm_widget *w,
		if (w->shift == 5) {
			clear_bit(WCD_MBHC_HPHL_PA_OFF_ACK,
				&msm8x16_wcd->mbhc.hph_pa_dac_state);
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_L_TEST, 0x04, 0x00);

			msm8x16_notifier_call(codec,
					WCD_EVENT_POST_HPHL_PA_OFF);
		} else if (w->shift == 4) {
			clear_bit(WCD_MBHC_HPHR_PA_OFF_ACK,
				&msm8x16_wcd->mbhc.hph_pa_dac_state);
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_ANALOG_RX_HPH_R_TEST, 0x04, 0x00);

			msm8x16_notifier_call(codec,
					WCD_EVENT_POST_HPHR_PA_OFF);
		}