Browse Source

Merge "asoc: Add dummy PCM backend"

qctecmdr 3 years ago
parent
commit
f1833cf0e8
5 changed files with 38 additions and 8 deletions
  1. 10 0
      asoc/kalama.c
  2. 6 4
      asoc/msm-audio-defs.h
  3. 6 4
      asoc/msm_common.c
  4. 6 0
      asoc/msm_dailink.h
  5. 10 0
      asoc/waipio.c

+ 10 - 0
asoc/kalama.c

@@ -479,6 +479,16 @@ static struct snd_soc_dai_link msm_common_be_dai_links[] = {
 		.ops = &msm_common_be_ops,
 		SND_SOC_DAILINK_REG(usb_audio_tx),
 	},
+	{
+		.name = LPASS_BE_PCM_DUMMY_TX_0,
+		.stream_name = LPASS_BE_PCM_DUMMY_TX_0,
+		.capture_only = 1,
+		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
+			SND_SOC_DPCM_TRIGGER_POST},
+		.ignore_suspend = 1,
+		.ops = &msm_common_be_ops,
+		SND_SOC_DAILINK_REG(pcm_dummy_tx0),
+	},
 };
 
 static struct snd_soc_dai_link msm_wcn_be_dai_links[] = {

+ 6 - 4
asoc/msm-audio-defs.h

@@ -37,8 +37,8 @@
 #define LPASS_BE_PRI_MI2S_TX "MI2S-LPAIF-TX-PRIMARY"
 #define LPASS_BE_SEC_MI2S_RX "MI2S-LPAIF-RX-SECONDARY"
 #define LPASS_BE_SEC_MI2S_TX "MI2S-LPAIF-TX-SECONDARY"
-#define LPASS_BE_TERT_MI2S_RX "MI2S-LPAIF-RX-TERTIARY"
-#define LPASS_BE_TERT_MI2S_TX "MI2S-LPAIF-TX-TERTIARY"
+#define LPASS_BE_TERT_MI2S_RX "MI2S-LPAIF_AUD-RX-SECONDARY"
+#define LPASS_BE_TERT_MI2S_TX "MI2S-LPAIF_AUD-TX-SECONDARY"
 #define LPASS_BE_QUAT_MI2S_RX "MI2S-LPAIF_RXTX-RX-PRIMARY"
 #define LPASS_BE_QUAT_MI2S_TX "MI2S-LPAIF_RXTX-TX-PRIMARY"
 #define LPASS_BE_QUIN_MI2S_RX "MI2S-LPAIF_VA-RX-PRIMARY"
@@ -69,8 +69,8 @@
 #define LPASS_BE_PRI_TDM_TX_0 "TDM-LPAIF-TX-PRIMARY"
 #define LPASS_BE_SEC_TDM_RX_0 "TDM-LPAIF-RX-SECONDARY"
 #define LPASS_BE_SEC_TDM_TX_0 "TDM-LPAIF-TX-SECONDARY"
-#define LPASS_BE_TERT_TDM_RX_0 "TDM-LPAIF-RX-TERTIARY"
-#define LPASS_BE_TERT_TDM_TX_0 "TDM-LPAIF-TX-TERTIARY"
+#define LPASS_BE_TERT_TDM_RX_0 "TDM-LPAIF_AUD-RX-SECONDARY"
+#define LPASS_BE_TERT_TDM_TX_0 "TDM-LPAIF_AUD-TX-SECONDARY"
 #define LPASS_BE_SEN_TDM_RX_0 "TDM-LPAIF_WSA-RX-PRIMARY"
 #define LPASS_BE_SEN_TDM_TX_0 "TDM-LPAIF_WSA-TX-PRIMARY"
 #define LPASS_BE_QUAT_TDM_RX_0 "TDM-LPAIF_RXTX-RX-PRIMARY"
@@ -118,4 +118,6 @@
 #define LPASS_BE_RT_PROXY_PCM_RX "PCM_RT_PROXY-RX-1"
 #define LPASS_BE_RT_PROXY_PCM_TX "PCM_RT_PROXY-TX-1"
 
+#define LPASS_BE_PCM_DUMMY_TX_0 "PCM_DUMMY-TX-0"
+
 #endif /*_MSM_AUDIO_DEFS_H*/

+ 6 - 4
asoc/msm_common.c

@@ -256,13 +256,15 @@ static int get_mi2s_tdm_auxpcm_intf_index(const char *stream_name)
 		return SEN_MI2S_TDM_AUXPCM;
 	else if (strnstr(stream_name, "LPAIF_VA", strlen(stream_name)))
 		return QUIN_MI2S_TDM_AUXPCM;
-	else if (strnstr(stream_name, "LPAIF_AUD", strlen(stream_name)))
-		return SEP_MI2S_TDM_AUXPCM;
+	else if (strnstr(stream_name, "LPAIF_AUD", strlen(stream_name))){
+		if (strnstr(stream_name, "PRIMARY", strlen(stream_name)))
+			return SEP_MI2S_TDM_AUXPCM;
+		else if (strnstr(stream_name, "SECONDARY", strlen(stream_name)))
+			return TER_MI2S_TDM_AUXPCM;
+	}
 	else if (strnstr(stream_name, "LPAIF", strlen(stream_name))) {
 		if (strnstr(stream_name, "PRIMARY", strlen(stream_name)))
 			return PRI_MI2S_TDM_AUXPCM;
-		else if (strnstr(stream_name, "TERTIARY", strlen(stream_name)))
-			return TER_MI2S_TDM_AUXPCM;
 		else if (strnstr(stream_name, "SECONDARY", strlen(stream_name)))
 			return SEC_MI2S_TDM_AUXPCM;
 	}

+ 6 - 0
asoc/msm_dailink.h

@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <sound/soc.h>
@@ -15,6 +16,11 @@ SND_SOC_DAILINK_DEFS(usb_audio_tx,
 	DAILINK_COMP_ARRAY(COMP_DUMMY()),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
 
+SND_SOC_DAILINK_DEFS(pcm_dummy_tx0,
+	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
+	DAILINK_COMP_ARRAY(COMP_DUMMY()),
+	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
+
 SND_SOC_DAILINK_DEFS(slimbus_7_rx,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("btfmslim_slave",

+ 10 - 0
asoc/waipio.c

@@ -472,6 +472,16 @@ static struct snd_soc_dai_link msm_common_be_dai_links[] = {
 		.ops = &msm_common_be_ops,
 		SND_SOC_DAILINK_REG(usb_audio_tx),
 	},
+	{
+		.name = LPASS_BE_PCM_DUMMY_TX_0,
+		.stream_name = LPASS_BE_PCM_DUMMY_TX_0,
+		.capture_only = 1,
+		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
+			SND_SOC_DPCM_TRIGGER_POST},
+		.ignore_suspend = 1,
+		.ops = &msm_common_be_ops,
+		SND_SOC_DAILINK_REG(pcm_dummy_tx0),
+	},
 };
 
 static struct snd_soc_dai_link msm_wcn_be_dai_links[] = {