audio-routing: Support Rx to Tx loopback

Static loopback is created between QUIN_TDM_RX_0 to Tx session.
Tx session is created with quin_tdm_tx_7 dummy port.

Change-Id: Ic634b47d1d7f80a10c6d2bc341a6d3ca8eae34c1
This commit is contained in:
Krishna Kishor Jha 2022-06-27 21:27:36 +05:30 • committed by Gerrit - the friendly Code Review server
commit 282aeeb375

View file

@ -56,6 +56,11 @@
#define STRING_LENGTH_OF_INT 12
#define MAX_USR_CTRL_CNT 128
#ifdef RX_TO_TX_LOOPBACK
#define RX_TO_TX_LOOPBACK_DUMMY_TX_PORT AFE_PORT_ID_QUINARY_TDM_TX_7
#define RX_TO_TX_LOOPBACK_RX_PORT AFE_PORT_ID_QUINARY_TDM_RX
#endif
static struct mutex routing_lock;
static struct cal_type_data *cal_data[MAX_ROUTING_CAL_TYPES];
@ -2527,7 +2532,19 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
&ec_ref_chmix_cfg[fedai_id]);
/* reset ec_ref config */
ec_ref_chmix_cfg[fedai_id].output_channel = 0;
} else
}
#ifdef RX_TO_TX_LOOPBACK
else if(session_type == SESSION_TYPE_TX &&
port_id == RX_TO_TX_LOOPBACK_DUMMY_TX_PORT) {
port_id = RX_TO_TX_LOOPBACK_RX_PORT;
copp_idx = adm_open(port_id, path_type,
sample_rate, channels, topology,
copp_perf_mode, bits_per_sample,
app_type, acdb_dev_id,
session_type, passthr_mode, copp_token);
}
#endif
else
copp_idx = adm_open(port_id, path_type,
sample_rate, channels, topology,
copp_perf_mode, bits_per_sample,
@ -19500,6 +19517,12 @@ static const struct snd_kcontrol_new mmul1_mixer_controls[] = {
MSM_BACKEND_DAI_QUAT_TDM_TX_3,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
#ifdef RX_TO_TX_LOOPBACK
SOC_DOUBLE_EXT("QUIN_TDM_TX_7", SND_SOC_NOPM,
MSM_BACKEND_DAI_QUIN_TDM_TX_7,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
#endif
SOC_DOUBLE_EXT("QUIN_TDM_TX_0", SND_SOC_NOPM,
MSM_BACKEND_DAI_QUIN_TDM_TX_0,
MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
@ -28315,7 +28338,9 @@ static const struct snd_soc_dapm_route intercon_tdm[] = {
{"MultiMedia1 Mixer", "QUAT_TDM_TX_1", "QUAT_TDM_TX_1"},
{"MultiMedia1 Mixer", "QUAT_TDM_TX_2", "QUAT_TDM_TX_2"},
{"MultiMedia1 Mixer", "QUAT_TDM_TX_3", "QUAT_TDM_TX_3"},
#ifdef RX_TO_TX_LOOPBACK
{"MultiMedia1 Mixer", "QUIN_TDM_TX_7", "QUIN_TDM_TX_7"},
#endif
{"MultiMedia1 Mixer", "QUIN_TDM_TX_0", "QUIN_TDM_TX_0"},
{"MultiMedia1 Mixer", "QUIN_TDM_TX_1", "QUIN_TDM_TX_1"},
{"MultiMedia1 Mixer", "QUIN_TDM_TX_2", "QUIN_TDM_TX_2"},