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

Commit ef225a42 authored by Gopikrishnaiah Anandan's avatar Gopikrishnaiah Anandan Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9330: Fix for VI feedback underflow errors



VI(voltage/current) feedback capture widget is part of speaker RX path.
When speaker is enabled, the VI feedback capture widget would be turned on.
During the shutdown of speaker RX path VI feedback codec path is
shutdown first and then the AFE port is closed. This will cause the
underflow errors during the shutdown seqeunce.
Change removes the vifeedback capture widget from playback path and
creates a new capture path. Userspace module will enable/disable the
VI feedback path via mixer control.

CRs-fixed: 591723
Change-Id: Ibceb5ff404e7cd7b73c490877e6b6e07faa06ab7
Signed-off-by: default avatarGopikrishnaiah Anandan <agopik@codeaurora.org>
parent 0a0b25b6
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -2255,6 +2255,9 @@ static const struct snd_kcontrol_new lineout4_ground_switch =
static const struct snd_kcontrol_new aif4_mad_switch =
	SOC_DAPM_SINGLE("Switch", TOMTOM_A_SVASS_CLKRST_CTL, 0, 1, 0);

static const struct snd_kcontrol_new aif4_vi_switch =
	SOC_DAPM_SINGLE("Switch", TOMTOM_A_SPKR1_PROT_EN, 3, 1, 0);

/* virtual port entries */
static int slim_tx_mixer_get(struct snd_kcontrol *kcontrol,
			     struct snd_ctl_elem_value *ucontrol)
@@ -3816,7 +3819,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
	{"AIF1 CAP", NULL, "AIF1_CAP Mixer"},
	{"AIF2 CAP", NULL, "AIF2_CAP Mixer"},
	{"AIF3 CAP", NULL, "AIF3_CAP Mixer"},
	{"AIF4 VI", NULL, "SPK_OUT"},

	/* VI Feedback */
	{"AIF4 VI", NULL, "VIONOFF"},
	{"VIONOFF", "Switch", "VIINPUT"},

	/* MAD */
	{"MADONOFF", "Switch", "MADINPUT"},
@@ -5582,6 +5588,16 @@ static int tomtom_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w,
		if (ret)
			pr_err("%s error in close_slim_sch_tx %d\n",
				__func__, ret);
		if (!dai->bus_down_in_recovery)
			ret = tomtom_codec_enable_slim_chmask(dai, false);
		if (ret < 0) {
			ret = wcd9xxx_disconnect_port(core,
				&dai->wcd9xxx_ch_list,
				dai->grph);
			pr_debug("%s: Disconnect TX port, ret = %d\n",
				__func__, ret);
		}

		snd_soc_update_bits(codec, TOMTOM_A_CDC_CLK_TX_CLK_EN_B2_CTL,
				0xC, 0x0);
		/*Disable V&I sensing*/
@@ -6346,6 +6362,11 @@ static const struct snd_soc_dapm_widget tomtom_dapm_widgets[] = {

	SND_SOC_DAPM_MIXER("LINEOUT4_PA_MIXER", SND_SOC_NOPM, 0, 0,
		lineout4_pa_mix, ARRAY_SIZE(lineout4_pa_mix)),

	SND_SOC_DAPM_SWITCH("VIONOFF", SND_SOC_NOPM, 0, 0,
			    &aif4_vi_switch),

	SND_SOC_DAPM_INPUT("VIINPUT"),
};

static irqreturn_t tomtom_slimbus_irq(int irq, void *data)