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

Commit b165cc03 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare
Browse files

ASoC: wcd9330: Explicitly reset MAD block on codec



It is possible that MAD block in codec can be in reset state when MAD is
enabled. This will cause MAD to not work as expected. Add fix to
explicitly reset/undo reset MAD block when MAD is enabled/disabled.

Change-Id: I30bf73b4e501e7e396e73c4dde9007b3218a91dc
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent c6297e1e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3377,6 +3377,10 @@ static int tomtom_codec_enable_mad(struct snd_soc_dapm_widget *w,

	switch (event) {
	case SND_SOC_DAPM_PRE_PMU:
		/* Undo reset for MAD */
		snd_soc_update_bits(codec, TOMTOM_A_SVASS_CLKRST_CTL,
				    0x02, 0x00);

		ret = tomtom_codec_config_mad(codec);
		if (ret) {
			pr_err("%s: Failed to config MAD\n", __func__);
@@ -3388,6 +3392,10 @@ static int tomtom_codec_enable_mad(struct snd_soc_dapm_widget *w,
				    0x02, 0x02);
		break;
	case SND_SOC_DAPM_POST_PMD:
		/* Reset the MAD block */
		snd_soc_update_bits(codec, TOMTOM_A_SVASS_CLKRST_CTL,
				    0x02, 0x02);

		/* Undo setup of MAD micbias to VDDIO */
		snd_soc_update_bits(codec, mad_cfilt_reg,
				    0x02, 0x00);