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

Commit e316908a authored by Vatsal Bucha's avatar Vatsal Bucha Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd937x: Enable and disable HPH OCP at PA to avoid CnP



Enable HPHR and HPHL OCP after PA enable and disable it
before PA disable to avoid CnP issues at teardown.

Change-Id: Ic08a8862a7fb4f40ecc6060de6aa1eadc11f1c0f
Signed-off-by: default avatarVatsal Bucha <vbucha@codeaurora.org>
parent 733128bb
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -127,8 +127,6 @@ static int wcd937x_init_reg(struct snd_soc_codec *codec)
	snd_soc_update_bits(codec, WCD937X_ANA_BIAS, 0x40, 0x00);
	snd_soc_update_bits(codec, WCD937X_HPH_OCP_CTL, 0xFF, 0x3A);
	snd_soc_update_bits(codec, WCD937X_RX_OCP_CTL, 0x0F, 0x02);
	snd_soc_update_bits(codec, WCD937X_HPH_R_TEST, 0x01, 0x01);
	snd_soc_update_bits(codec, WCD937X_HPH_L_TEST, 0x01, 0x01);

	return 0;
}
@@ -644,6 +642,7 @@ static int wcd937x_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,

		snd_soc_update_bits(codec, WCD937X_HPH_NEW_INT_HPH_TIMER1,
				    0x02, 0x02);
		snd_soc_update_bits(codec, WCD937X_HPH_R_TEST, 0x01, 0x01);
		if (hph_mode == CLS_AB || hph_mode == CLS_AB_HIFI)
			snd_soc_update_bits(codec, WCD937X_ANA_RX_SUPPLIES,
					    0x02, 0x02);
@@ -653,6 +652,7 @@ static int wcd937x_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,
						(WCD_RX2 << 0x10));
		break;
	case SND_SOC_DAPM_PRE_PMD:
		snd_soc_update_bits(codec, WCD937X_HPH_R_TEST, 0x01, 0x00);
		if (wcd937x->update_wcd_event)
			wcd937x->update_wcd_event(wcd937x->handle,
						WCD_BOLERO_EVT_RX_MUTE,
@@ -717,6 +717,7 @@ static int wcd937x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,

		snd_soc_update_bits(codec, WCD937X_HPH_NEW_INT_HPH_TIMER1,
				    0x02, 0x02);
		snd_soc_update_bits(codec, WCD937X_HPH_L_TEST, 0x01, 0x01);
		if (hph_mode == CLS_AB || hph_mode == CLS_AB_HIFI)
			snd_soc_update_bits(codec, WCD937X_ANA_RX_SUPPLIES,
					    0x02, 0x02);
@@ -726,6 +727,7 @@ static int wcd937x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
						(WCD_RX1 << 0x10));
		break;
	case SND_SOC_DAPM_PRE_PMD:
		snd_soc_update_bits(codec, WCD937X_HPH_L_TEST, 0x01, 0x00);
		if (wcd937x->update_wcd_event)
			wcd937x->update_wcd_event(wcd937x->handle,
						WCD_BOLERO_EVT_RX_MUTE,