浏览代码

asoc: Add hostless entries in routing driver

Add hostless nodes for RX_CDC_DMA_RX_0 and TX_CDC_DMA_TX_3
interfaces to support HFP/FM use cases.
Add missing port-ids in afe driver.

CRs-Fixed: 2281591
Change-Id: I634a6970b7c47320120cb850ad94bd69376ac181
Signed-off-by: Aditya Bavanari <[email protected]>
Aditya Bavanari 6 年之前
父节点
当前提交
54ca7d1b91
共有 4 个文件被更改,包括 114 次插入14 次删除
  1. 23 0
      asoc/msm-dai-fe.c
  2. 35 0
      asoc/msm-pcm-routing-v2.c
  3. 42 0
      dsp/q6afe.c
  4. 14 14
      dsp/q6audio-v2.c

+ 23 - 0
asoc/msm-dai-fe.c

@@ -575,6 +575,29 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
 		.name = "CDC_DMA_HOSTLESS",
 		.probe = fe_dai_probe,
 	},
+	{
+		.capture = {
+			.stream_name = "TX3_CDC_DMA_HOSTLESS Capture",
+			.aif_name = "TX3_CDC_DMA_UL_HL",
+			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |
+				SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |
+				SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
+				SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
+				SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
+				SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_352800 |
+				SNDRV_PCM_RATE_384000,
+			.formats = SNDRV_PCM_FMTBIT_S16_LE |
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S24_3LE,
+			.channels_min = 1,
+			.channels_max = 8,
+			.rate_min = 8000,
+			.rate_max = 384000,
+		},
+		.ops = &msm_fe_dai_ops,
+		.name = "TX3_CDC_DMA_HOSTLESS",
+		.probe = fe_dai_probe,
+	},
 	{
 		.playback = {
 			.stream_name = "INT_FM_HOSTLESS Playback",

+ 35 - 0
asoc/msm-pcm-routing-v2.c

@@ -17528,6 +17528,8 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
 		0, 0, 0, 0),
 	SND_SOC_DAPM_AIF_OUT("CDC_DMA_UL_HL", "CDC_DMA_HOSTLESS Capture",
 		0, 0, 0, 0),
+	SND_SOC_DAPM_AIF_OUT("TX3_CDC_DMA_UL_HL",
+		"TX3_CDC_DMA_HOSTLESS Capture", 0, 0, 0, 0),
 	SND_SOC_DAPM_AIF_OUT("CPE_LSM_UL_HL", "CPE LSM capture",
 		0, 0, 0, 0),
 	SND_SOC_DAPM_AIF_IN("SLIM1_DL_HL", "SLIMBUS1_HOSTLESS Playback",
@@ -18274,6 +18276,8 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
 				&a2dp_slim7_switch_mixer_controls),
 	SND_SOC_DAPM_SWITCH("WSA_CDC_DMA_RX_0_DL_HL", SND_SOC_NOPM, 0, 0,
 				&cdc_dma_fm_switch_mixer_controls),
+	SND_SOC_DAPM_SWITCH("RX_CDC_DMA_RX_0_DL_HL", SND_SOC_NOPM, 0, 0,
+				&cdc_dma_fm_switch_mixer_controls),
 
 	/* Mixer definitions */
 	SND_SOC_DAPM_MIXER("PRI_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
@@ -18575,6 +18579,14 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
 				SND_SOC_NOPM, 0, 0,
 				quat_tdm_rx_2_voice_mixer_controls,
 				ARRAY_SIZE(quat_tdm_rx_2_voice_mixer_controls)),
+	SND_SOC_DAPM_MIXER("WSA_CDC_DMA_RX_0_Voice Mixer",
+			   SND_SOC_NOPM, 0, 0,
+			   wsa_cdc_dma_rx_0_voice_mixer_controls,
+			   ARRAY_SIZE(wsa_cdc_dma_rx_0_voice_mixer_controls)),
+	SND_SOC_DAPM_MIXER("RX_CDC_DMA_RX_0_Voice Mixer",
+			   SND_SOC_NOPM, 0, 0,
+			   rx_cdc_dma_rx_0_voice_mixer_controls,
+			   ARRAY_SIZE(rx_cdc_dma_rx_0_voice_mixer_controls)),
 	SND_SOC_DAPM_MIXER("Voip_Tx Mixer",
 				SND_SOC_NOPM, 0, 0, tx_voip_mixer_controls,
 				ARRAY_SIZE(tx_voip_mixer_controls)),
@@ -20826,6 +20838,14 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{"QUAT_TDM_RX_2_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
 	{"QUAT_TDM_RX_2", NULL, "QUAT_TDM_RX_2_Voice Mixer"},
 
+	{"WSA_CDC_DMA_RX_0_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
+	{"WSA_CDC_DMA_RX_0_Voice Mixer", "VoiceMMode2", "VOICEMMODE2_DL"},
+	{"WSA_CDC_DMA_RX_0", NULL, "WSA_CDC_DMA_RX_0_Voice Mixer"},
+
+	{"RX_CDC_DMA_RX_0_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
+	{"RX_CDC_DMA_RX_0_Voice Mixer", "VoiceMMode2", "VOICEMMODE2_DL"},
+	{"RX_CDC_DMA_RX_0", NULL, "RX_CDC_DMA_RX_0_Voice Mixer"},
+
 	{"VOC_EXT_EC MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"},
 	{"VOC_EXT_EC MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"},
 	{"VOC_EXT_EC MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"},
@@ -20966,6 +20986,12 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{"VoiceMMode1_Tx Mixer", "QUAT_AUX_PCM_TX_MMode1", "QUAT_AUX_PCM_TX"},
 	{"VoiceMMode1_Tx Mixer", "QUIN_AUX_PCM_TX_MMode1", "QUIN_AUX_PCM_TX"},
 	{"VoiceMMode1_Tx Mixer", "QUAT_TDM_TX_0_MMode1", "QUAT_TDM_TX_0"},
+	{"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_0_MMode1", "TX_CDC_DMA_TX_0"},
+	{"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_1_MMode1", "TX_CDC_DMA_TX_1"},
+	{"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_2_MMode1", "TX_CDC_DMA_TX_2"},
+	{"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_3_MMode1", "TX_CDC_DMA_TX_3"},
+	{"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_4_MMode1", "TX_CDC_DMA_TX_4"},
+	{"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_5_MMode1", "TX_CDC_DMA_TX_5"},
 	{"VOICEMMODE1_UL", NULL, "VoiceMMode1_Tx Mixer"},
 
 	{"VoiceMMode2_Tx Mixer", "PRI_TX_MMode2", "PRI_I2S_TX"},
@@ -20984,6 +21010,12 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{"VoiceMMode2_Tx Mixer", "TERT_AUX_PCM_TX_MMode2", "TERT_AUX_PCM_TX"},
 	{"VoiceMMode2_Tx Mixer", "QUAT_AUX_PCM_TX_MMode2", "QUAT_AUX_PCM_TX"},
 	{"VoiceMMode2_Tx Mixer", "QUIN_AUX_PCM_TX_MMode2", "QUIN_AUX_PCM_TX"},
+	{"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_0_MMode2", "TX_CDC_DMA_TX_0"},
+	{"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_1_MMode2", "TX_CDC_DMA_TX_1"},
+	{"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_2_MMode2", "TX_CDC_DMA_TX_2"},
+	{"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_3_MMode2", "TX_CDC_DMA_TX_3"},
+	{"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_4_MMode2", "TX_CDC_DMA_TX_4"},
+	{"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_5_MMode2", "TX_CDC_DMA_TX_5"},
 	{"VOICEMMODE2_UL", NULL, "VoiceMMode2_Tx Mixer"},
 
 	{"Voip_Tx Mixer", "PRI_TX_Voip", "PRI_I2S_TX"},
@@ -21022,6 +21054,9 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{"WSA_CDC_DMA_RX_0_DL_HL", "Switch", "CDC_DMA_DL_HL"},
 	{"WSA_CDC_DMA_RX_0", NULL, "WSA_CDC_DMA_RX_0_DL_HL"},
 	{"CDC_DMA_UL_HL", NULL, "VA_CDC_DMA_TX_0"},
+	{"RX_CDC_DMA_RX_0_DL_HL", "Switch", "CDC_DMA_DL_HL"},
+	{"RX_CDC_DMA_RX_0", NULL, "RX_CDC_DMA_RX_0_DL_HL"},
+	{"TX3_CDC_DMA_UL_HL", NULL, "TX_CDC_DMA_TX_3"},
 	{"LSM1 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
 	{"LSM1 Mixer", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
 	{"LSM1 Mixer", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},

+ 42 - 0
dsp/q6afe.c

@@ -4453,6 +4453,34 @@ int afe_get_port_index(u16 port_id)
 		return IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_1;
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 		return IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_2;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_0;
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
+		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_0;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_1;
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_1:
+		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_1;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_2:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_2;
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_2:
+		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_2;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_3:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_3;
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_3:
+		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_3;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_4:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_4;
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_4:
+		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_4;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_5:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_5;
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_5:
+		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_5;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_6:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_6;
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_7:
+		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_7;
 	default:
 		pr_err("%s: port 0x%x\n", __func__, port_id);
 		return -EINVAL;
@@ -6580,6 +6608,20 @@ int afe_validate_port(u16 port_id)
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_2:
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_2:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_3:
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_3:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_4:
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_4:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_5:
+	case AFE_PORT_ID_TX_CODEC_DMA_TX_5:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_6:
+	case AFE_PORT_ID_RX_CODEC_DMA_RX_7:
 	{
 		ret = 0;
 		break;

+ 14 - 14
dsp/q6audio-v2.c

@@ -655,33 +655,33 @@ int q6audio_get_port_id(u16 port_id)
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
 		return AFE_PORT_ID_VA_CODEC_DMA_TX_1;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_0;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_0;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
-		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_0;
+		return AFE_PORT_ID_TX_CODEC_DMA_TX_0;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_1;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_1;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_1:
-		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_1;
+		return AFE_PORT_ID_TX_CODEC_DMA_TX_1;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_2:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_2;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_2;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_2:
-		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_2;
+		return AFE_PORT_ID_TX_CODEC_DMA_TX_2;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_3:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_3;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_3;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_3:
-		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_3;
+		return AFE_PORT_ID_TX_CODEC_DMA_TX_3;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_4:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_4;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_4;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_4:
-		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_4;
+		return AFE_PORT_ID_TX_CODEC_DMA_TX_4;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_5:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_5;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_5;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_5:
-		return IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_5;
+		return AFE_PORT_ID_TX_CODEC_DMA_TX_5;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_6:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_6;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_6;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_7:
-		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_7;
+		return AFE_PORT_ID_RX_CODEC_DMA_RX_7;
 	default:
 		pr_warn("%s: Invalid port_id %d\n", __func__, port_id);
 		return -EINVAL;