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

Commit ebf640f5 authored by Gopikrishnaiah Anandan's avatar Gopikrishnaiah Anandan
Browse files

ASoC: wcd9320: Fix for VI feedback underflow errors



VIfeedback capture widget was added in the 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/disbale the VI
feedback path via mixer control.

Change-Id: Id49f0cf2b1513b57014f1893d0facd72554166ed
CRs-fixed: 591723
Signed-off-by: default avatarGopikrishnaiah Anandan <agopik@codeaurora.org>
parent ee794fa1
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -2153,6 +2153,8 @@ static const struct snd_kcontrol_new lineout4_ground_switch =
static const struct snd_kcontrol_new aif4_mad_switch =
	SOC_DAPM_SINGLE("Switch", TAIKO_A_CDC_CLK_OTHR_CTL, 4, 1, 0);

static const struct snd_kcontrol_new aif4_vi_switch =
	SOC_DAPM_SINGLE("Switch", TAIKO_A_SPKR_PROT_EN, 3, 1, 0);
/* virtual port entries */
static int slim_tx_mixer_get(struct snd_kcontrol *kcontrol,
			     struct snd_ctl_elem_value *ucontrol)
@@ -3602,7 +3604,9 @@ 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 */
	{"AIF4 MAD", NULL, "CDC_CONN"},
@@ -5267,6 +5271,15 @@ static int taiko_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);
		ret = taiko_codec_enable_slim_chmask(dai, false);
		if (ret < 0) {
			ret = wcd9xxx_disconnect_port(core,
						      &dai->wcd9xxx_ch_list,
						      dai->grph);
			pr_debug("%s: Disconnect RX port, ret = %d\n",
				 __func__, ret);
		}

		snd_soc_update_bits(codec, TAIKO_A_CDC_CLK_TX_CLK_EN_B2_CTL,
				0xC, 0x0);
		/*Disable V&I sensing*/
@@ -5958,6 +5971,10 @@ static const struct snd_soc_dapm_widget taiko_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 taiko_slimbus_irq(int irq, void *data)