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

Commit 305e3774 authored by Surendar karka's avatar Surendar karka
Browse files

ASoC: msm: add afe loopback support for msm8952



Add machine driver changes for AFE Rx to
Tx loopback.

CRs-Fixed: 2080421
Change-Id: I304e50a9c3e531e3f176b4ff6aa90c96f5d9b3cf
Signed-off-by: default avatarSurendar karka <sukark@codeaurora.org>
parent a361e388
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1480,6 +1480,7 @@ Optional properties:
- qcom,wsa-max-devs : Maximum number of WSA881x devices present in the target
- qcom,wsa-devs : List of phandles for all possible WSA881x devices supported for the target
- qcom,wsa-aux-dev-prefix : Name prefix with Left/Right configuration for WSA881x device
- qcom,afe-rxtx-lb: AFE RX to TX loopback.

Example:

+28 −2
Original line number Diff line number Diff line
@@ -1523,6 +1523,22 @@ static struct snd_soc_dai_link msm8952_tdm_be_dai_link[] = {
	},
};

static struct snd_soc_dai_link msm8952_afe_rxtx_lb_be_dai_link[] = {
	{
		.name = LPASS_BE_AFE_LOOPBACK_TX,
		.stream_name = "AFE Loopback Capture",
		.cpu_dai_name = "msm-dai-q6-dev.24577",
		.platform_name = "msm-pcm-routing",
		.codec_name = "msm-stub-codec.1",
		.codec_dai_name = "msm-stub-tx",
		.no_pcm = 1,
		.dpcm_capture = 1,
		.be_id = MSM_BACKEND_DAI_AFE_LOOPBACK_TX,
		.ignore_pmdown_time = 1,
		.ignore_suspend = 1,
	},
};

struct msm895x_wsa881x_dev_info {
	struct device_node *of_node;
	u32 index;
@@ -1538,7 +1554,8 @@ ARRAY_SIZE(msm8952_tdm_fe_dai) +
ARRAY_SIZE(msm8952_common_be_dai) +
ARRAY_SIZE(msm8952_tomtom_be_dai) +
ARRAY_SIZE(msm8952_quin_dai_link) +
ARRAY_SIZE(msm8952_tdm_be_dai_link)];
ARRAY_SIZE(msm8952_tdm_be_dai_link) +
ARRAY_SIZE(msm8952_afe_rxtx_lb_be_dai_link)];

static struct snd_soc_dai_link msm8952_tasha_dai_links[
ARRAY_SIZE(msm8952_common_fe_dai) +
@@ -1547,7 +1564,8 @@ ARRAY_SIZE(msm8952_tdm_fe_dai) +
ARRAY_SIZE(msm8952_common_be_dai) +
ARRAY_SIZE(msm8952_tasha_be_dai) +
ARRAY_SIZE(msm8952_hdmi_dba_dai_link) +
ARRAY_SIZE(msm8952_tdm_be_dai_link)];
ARRAY_SIZE(msm8952_tdm_be_dai_link) +
ARRAY_SIZE(msm8952_afe_rxtx_lb_be_dai_link)];

int msm8952_init_wsa_dev(struct platform_device *pdev,
			struct snd_soc_card *card)
@@ -1803,6 +1821,14 @@ struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
			sizeof(msm8952_tdm_be_dai_link));
		len5 += ARRAY_SIZE(msm8952_tdm_be_dai_link);
	}
	if (of_property_read_bool(dev->of_node, "qcom,afe-rxtx-lb")) {
		dev_dbg(dev, "%s(): AFE RX to TX loopback supported\n",
				__func__);
		memcpy(msm8952_dai_links + len5,
		       msm8952_afe_rxtx_lb_be_dai_link,
		       sizeof(msm8952_afe_rxtx_lb_be_dai_link));
		len5 += ARRAY_SIZE(msm8952_afe_rxtx_lb_be_dai_link);
	}
	card->dai_link = msm8952_dai_links;
	card->num_links = len5;
	card->dev = dev;