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

Commit c40e5b74 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: msm: qdsp6v2: add FM volume support for Quat MI2S



APQ8084 uses Quaternary MI2S port for connecting a FM
chip. Add routes for FM device volume control using MI2S
AFE loopback path.

Change-Id: I1ec22efdf7054f524bf8f72f165bd09cb7af45cd
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent bb27c068
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -395,6 +395,24 @@ static int msm_qti_pp_set_fm_vol_mixer(struct snd_kcontrol *kcontrol,
	return 0;
}

static int msm_qti_pp_get_quat_mi2s_fm_vol_mixer(struct snd_kcontrol *kcontrol,
				       struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] = msm_route_fm_vol_control;
	return 0;
}

static int msm_qti_pp_set_quat_mi2s_fm_vol_mixer(struct snd_kcontrol *kcontrol,
			    struct snd_ctl_elem_value *ucontrol)
{
	afe_loopback_gain(AFE_PORT_ID_QUATERNARY_MI2S_TX,
			  ucontrol->value.integer.value[0]);

	msm_route_fm_vol_control = ucontrol->value.integer.value[0];

	return 0;
}

static int msm_qti_pp_get_hfp_vol_mixer(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
@@ -479,6 +497,9 @@ static const struct snd_kcontrol_new int_fm_vol_mixer_controls[] = {
	SOC_SINGLE_EXT_TLV("Internal FM RX Volume", SND_SOC_NOPM, 0,
	INT_RX_VOL_GAIN, 0, msm_qti_pp_get_fm_vol_mixer,
	msm_qti_pp_set_fm_vol_mixer, fm_rx_vol_gain),
	SOC_SINGLE_EXT_TLV("Quat MI2S FM RX Volume", SND_SOC_NOPM, 0,
	INT_RX_VOL_GAIN, 0, msm_qti_pp_get_quat_mi2s_fm_vol_mixer,
	msm_qti_pp_set_quat_mi2s_fm_vol_mixer, fm_rx_vol_gain),
};

static const struct snd_kcontrol_new int_hfp_vol_mixer_controls[] = {