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

Commit 3061c7e9 authored by Sachin Mohan Gadag's avatar Sachin Mohan Gadag
Browse files

asoc: sdm660: Add new dais for multiple record session



Add new dais to support multiple record session in
compress path for tavil codec.

Change-Id: I112e51019975393ccf9455418c5697f322265614
Signed-off-by: default avatarSachin Mohan Gadag <sgadag@codeaurora.org>
parent 75723c5c
Loading
Loading
Loading
Loading
+92 −13
Original line number Diff line number Diff line
@@ -595,6 +595,79 @@ static struct snd_soc_dai_link msm_ext_tasha_be_dai[] = {
	},
};

static struct snd_soc_dai_link msm_ext_compress_capture_dai[] = {
	{/* tavil:hw:x,40 */
		.name = "Compress9",
		.stream_name = "Compress9",
		.cpu_dai_name = "MultiMedia17",
		.platform_name = "msm-compress-dsp",
		.dynamic = 1,
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
			    SND_SOC_DPCM_TRIGGER_POST},
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
		.ignore_suspend = 1,
		.id = MSM_FRONTEND_DAI_MULTIMEDIA17,
	},
	{/* tavil:hw:x,41 */
		.name = "Compress10",
		.stream_name = "Compress10",
		.cpu_dai_name = "MultiMedia18",
		.platform_name = "msm-compress-dsp",
		.dynamic = 1,
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
			    SND_SOC_DPCM_TRIGGER_POST},
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
		.ignore_suspend = 1,
		.id = MSM_FRONTEND_DAI_MULTIMEDIA18,
	},
	{/* tavil:hw:x,42 */
		.name = "Compress11",
		.stream_name = "Compress11",
		.cpu_dai_name = "MultiMedia19",
		.platform_name = "msm-compress-dsp",
		.dynamic = 1,
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
			    SND_SOC_DPCM_TRIGGER_POST},
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
		.ignore_suspend = 1,
		.id = MSM_FRONTEND_DAI_MULTIMEDIA19,
	},
	{/* tavil:hw:x,43 */
		.name = "Compress12",
		.stream_name = "Compress12",
		.cpu_dai_name = "MultiMedia28",
		.platform_name = "msm-compress-dsp",
		.dynamic = 1,
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
			    SND_SOC_DPCM_TRIGGER_POST},
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
		.ignore_suspend = 1,
		.id = MSM_FRONTEND_DAI_MULTIMEDIA28,
	},
	{/* tavil:hw:x,44 */
		.name = "Compress13",
		.stream_name = "Compress13",
		.cpu_dai_name = "MultiMedia29",
		.platform_name = "msm-compress-dsp",
		.dynamic = 1,
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
			    SND_SOC_DPCM_TRIGGER_POST},
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
		.ignore_suspend = 1,
		.id = MSM_FRONTEND_DAI_MULTIMEDIA29,
	},
};

static struct snd_soc_dai_link msm_ext_tavil_be_dai[] = {
	{
		.name = LPASS_BE_SLIMBUS_0_RX,
@@ -2010,6 +2083,7 @@ ARRAY_SIZE(ext_disp_be_dai_link)];
static struct snd_soc_dai_link msm_ext_tavil_dai_links[
ARRAY_SIZE(msm_ext_common_fe_dai) +
ARRAY_SIZE(msm_ext_tavil_fe_dai) +
ARRAY_SIZE(msm_ext_compress_capture_dai) +
ARRAY_SIZE(msm_ext_common_be_dai) +
ARRAY_SIZE(msm_ext_tavil_be_dai) +
ARRAY_SIZE(msm_mi2s_be_dai_links) +
@@ -2029,7 +2103,7 @@ struct snd_soc_card *populate_snd_card_dailinks(struct device *dev,
{
	struct snd_soc_card *card;
	struct snd_soc_dai_link *msm_ext_dai_links = NULL;
	int ret, len1, len2, len3, len4;
	int ret, len1, len2, len3, len4, len5;
	enum codec_variant codec_ver = 0;

	if (snd_card_val == EXT_SND_CARD_TASHA) {
@@ -2103,50 +2177,55 @@ struct snd_soc_card *populate_snd_card_dailinks(struct device *dev,
				sizeof(ext_disp_be_dai_link));
			len4 += ARRAY_SIZE(ext_disp_be_dai_link);
		}
		len5 = len4;
		msm_ext_dai_links = msm_ext_tasha_dai_links;
	} else if (strnstr(card->name, "tavil", strlen(card->name))) {
		len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
		len2 = len1 + ARRAY_SIZE(msm_ext_tavil_fe_dai);
		len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
		len3 = len2 + ARRAY_SIZE(msm_ext_compress_capture_dai);
		len4 = len3 + ARRAY_SIZE(msm_ext_common_be_dai);
		memcpy(msm_ext_tavil_dai_links, msm_ext_common_fe_dai,
		       sizeof(msm_ext_common_fe_dai));
		memcpy(msm_ext_tavil_dai_links + len1,
		       msm_ext_tavil_fe_dai, sizeof(msm_ext_tavil_fe_dai));
		memcpy(msm_ext_tavil_dai_links + len2,
		       msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
		       msm_ext_compress_capture_dai,
		       sizeof(msm_ext_compress_capture_dai));
		memcpy(msm_ext_tavil_dai_links + len3,
		       msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
		memcpy(msm_ext_tavil_dai_links + len4,
		       msm_ext_tavil_be_dai, sizeof(msm_ext_tavil_be_dai));
		len4 = len3 + ARRAY_SIZE(msm_ext_tavil_be_dai);
		len5 = len4 + ARRAY_SIZE(msm_ext_tavil_be_dai);
		if (of_property_read_bool(dev->of_node,
					  "qcom,mi2s-audio-intf")) {
			memcpy(msm_ext_tavil_dai_links + len4,
			memcpy(msm_ext_tavil_dai_links + len5,
			       msm_mi2s_be_dai_links,
			       sizeof(msm_mi2s_be_dai_links));
			len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
			len5 += ARRAY_SIZE(msm_mi2s_be_dai_links);
		}
		if (of_property_read_bool(dev->of_node,
					  "qcom,auxpcm-audio-intf")) {
			memcpy(msm_ext_tavil_dai_links + len4,
			memcpy(msm_ext_tavil_dai_links + len5,
			       msm_auxpcm_be_dai_links,
			       sizeof(msm_auxpcm_be_dai_links));
			len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
			len5 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
		}
		if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
			dev_dbg(dev, "%s(): WCN BTFM support present\n",
					__func__);
			memcpy(msm_ext_tavil_dai_links + len4,
			memcpy(msm_ext_tavil_dai_links + len5,
				   msm_wcn_be_dai_links,
				   sizeof(msm_wcn_be_dai_links));
			len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
			len5 += ARRAY_SIZE(msm_wcn_be_dai_links);
		}
		if (of_property_read_bool(dev->of_node,
					  "qcom,ext-disp-audio-rx")) {
			dev_dbg(dev, "%s(): ext disp audio support present\n",
					__func__);
			memcpy(msm_ext_tavil_dai_links + len4,
			memcpy(msm_ext_tavil_dai_links + len5,
				ext_disp_be_dai_link,
				sizeof(ext_disp_be_dai_link));
			len4 += ARRAY_SIZE(ext_disp_be_dai_link);
			len5 += ARRAY_SIZE(ext_disp_be_dai_link);
		}
		msm_ext_dai_links = msm_ext_tavil_dai_links;
	} else {
@@ -2155,7 +2234,7 @@ struct snd_soc_card *populate_snd_card_dailinks(struct device *dev,
		return NULL;
	}
	card->dai_link = msm_ext_dai_links;
	card->num_links = len4;
	card->num_links = len5;

	return card;
}