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

Commit 82dc8dd4 authored by Laxminath Kasam's avatar Laxminath Kasam
Browse files

ARM: dts: msm: Disable WSA for internal codec SDM660



Disable WSA nodes on internal codec using
bool property.

Change-Id: Ia404609382f12279ab091cbb69a16a2060ac7fb4
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent 9335a12b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1649,6 +1649,7 @@ Optional properties:
capacitor mode.
- qcom,msm-micbias2-ext-cap : Boolean. Enable micbias2 external
capacitor mode.
- qcom,wsa-disable : Boolean. Disables WSA speaker dailinks from sound node.
- qcom,msm-spk-ext-pa : GPIO which enables external speaker pa.
- qcom,msm-mclk-freq : This property is used to inform machine driver about
mclk frequency needs to be configured for internal and external PA.
@@ -1685,6 +1686,7 @@ Example:
		qcom,msm-mclk-freq = <9600000>;
		qcom,msm-mbhc-hphl-swh = <0>;
		qcom,msm-mbhc-gnd-swh = <0>;
		qcom,wsa-disable;
		qcom,msm-mbhc-moist-cfg = <1>, <3>, <0>;
		qcom,msm-hs-micbias-type = "internal";
		qcom,msm-micbias1-ext-cap;
+1 −0
Original line number Diff line number Diff line
@@ -810,6 +810,7 @@
		status = "disabled";
		compatible = "qcom,sdm660-asoc-snd";
		qcom,model = "sdm660-snd-card";
		qcom,wsa-disable;
		qcom,wcn-btfm;
		qcom,mi2s-audio-intf;
		qcom,auxpcm-audio-intf;
+5 −3
Original line number Diff line number Diff line
@@ -2864,10 +2864,12 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
		ret = -EPROBE_DEFER;
		goto err;
	}

	if (!of_property_read_bool(pdev->dev.of_node, "qcom,wsa-disable")) {
		ret = msm_init_wsa_dev(pdev, card);
		if (ret)
			goto err;

	}

	ret = devm_snd_soc_register_card(&pdev->dev, card);
	if (ret == -EPROBE_DEFER) {
+63 −34
Original line number Diff line number Diff line
@@ -2222,21 +2222,6 @@ static struct snd_soc_dai_link msm_int_dai[] = {
		.codec_name = "snd-soc-dummy",
	},
	{/* hw:x,35 */
		.name = LPASS_BE_INT5_MI2S_TX,
		.stream_name = "INT5 MI2S Capture",
		.cpu_dai_name = "msm-dai-q6-mi2s.12",
		.platform_name = "msm-pcm-hostless",
		.codec_name = "msm_sdw_codec",
		.codec_dai_name = "msm_sdw_vifeedback",
		.be_id = MSM_BACKEND_DAI_INT5_MI2S_TX,
		.be_hw_params_fixup = int_mi2s_be_hw_params_fixup,
		.ops = &msm_sdw_mi2s_be_ops,
		.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
		.ignore_suspend = 1,
		.dpcm_capture = 1,
		.ignore_pmdown_time = 1,
	},
	{/* hw:x,36 */
		.name = "Primary MI2S_RX Hostless",
		.stream_name = "Primary MI2S_RX Hostless",
		.cpu_dai_name = "PRI_MI2S_RX_HOSTLESS",
@@ -2253,7 +2238,7 @@ static struct snd_soc_dai_link msm_int_dai[] = {
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
	},
	{/* hw:x,37 */
	{/* hw:x,36 */
		.name = "Secondary MI2S_RX Hostless",
		.stream_name = "Secondary MI2S_RX Hostless",
		.cpu_dai_name = "SEC_MI2S_RX_HOSTLESS",
@@ -2270,7 +2255,7 @@ static struct snd_soc_dai_link msm_int_dai[] = {
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
	},
	{/* hw:x,38 */
	{/* hw:x,37 */
		.name = "Tertiary MI2S_RX Hostless",
		.stream_name = "Tertiary MI2S_RX Hostless",
		.cpu_dai_name = "TERT_MI2S_RX_HOSTLESS",
@@ -2287,7 +2272,7 @@ static struct snd_soc_dai_link msm_int_dai[] = {
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
	},
	{/* hw:x,39 */
	{/* hw:x,38 */
		.name = "INT0 MI2S_RX Hostless",
		.stream_name = "INT0 MI2S_RX Hostless",
		.cpu_dai_name = "INT0_MI2S_RX_HOSTLESS",
@@ -2304,6 +2289,28 @@ static struct snd_soc_dai_link msm_int_dai[] = {
		.codec_dai_name = "snd-soc-dummy-dai",
		.codec_name = "snd-soc-dummy",
	},
};


static struct snd_soc_dai_link msm_int_wsa_dai[] = {
	{/* hw:x,39 */
		.name = LPASS_BE_INT5_MI2S_TX,
		.stream_name = "INT5_mi2s Capture",
		.cpu_dai_name = "msm-dai-q6-mi2s.12",
		.platform_name = "msm-pcm-hostless",
		.codec_name = "msm_sdw_codec",
		.codec_dai_name = "msm_sdw_vifeedback",
		.be_id = MSM_BACKEND_DAI_INT5_MI2S_TX,
		.be_hw_params_fixup = int_mi2s_be_hw_params_fixup,
		.ops = &msm_sdw_mi2s_be_ops,
		.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
		.ignore_suspend = 1,
		.dpcm_capture = 1,
		.ignore_pmdown_time = 1,
	},
};

static struct snd_soc_dai_link msm_int_be_dai[] = {
	/* Backend I2S DAI Links */
	{
		.name = LPASS_BE_INT0_MI2S_RX,
@@ -2338,21 +2345,6 @@ static struct snd_soc_dai_link msm_int_dai[] = {
		.ops = &msm_int_mi2s_be_ops,
		.ignore_suspend = 1,
	},
	{
		.name = LPASS_BE_INT4_MI2S_RX,
		.stream_name = "INT4 MI2S Playback",
		.cpu_dai_name = "msm-dai-q6-mi2s.11",
		.platform_name = "msm-pcm-routing",
		.codec_name = "msm_sdw_codec",
		.codec_dai_name = "msm_sdw_i2s_rx1",
		.no_pcm = 1,
		.dpcm_playback = 1,
		.be_id = MSM_BACKEND_DAI_INT4_MI2S_RX,
		.init = &msm_sdw_audrx_init,
		.be_hw_params_fixup = int_mi2s_be_hw_params_fixup,
		.ops = &msm_sdw_mi2s_be_ops,
		.ignore_suspend = 1,
	},
	{
		.name = LPASS_BE_INT2_MI2S_TX,
		.stream_name = "INT2 MI2S Capture",
@@ -2893,11 +2885,32 @@ static struct snd_soc_dai_link msm_wcn_be_dai_links[] = {
	},
};

static struct snd_soc_dai_link msm_wsa_be_dai_links[] = {
	{
		.name = LPASS_BE_INT4_MI2S_RX,
		.stream_name = "INT4 MI2S Playback",
		.cpu_dai_name = "msm-dai-q6-mi2s.11",
		.platform_name = "msm-pcm-routing",
		.codec_name = "msm_sdw_codec",
		.codec_dai_name = "msm_sdw_i2s_rx1",
		.no_pcm = 1,
		.dpcm_playback = 1,
		.be_id = MSM_BACKEND_DAI_INT4_MI2S_RX,
		.init = &msm_sdw_audrx_init,
		.be_hw_params_fixup = int_mi2s_be_hw_params_fixup,
		.ops = &msm_sdw_mi2s_be_ops,
		.ignore_suspend = 1,
	},
};

static struct snd_soc_dai_link msm_int_dai_links[
ARRAY_SIZE(msm_int_dai) +
ARRAY_SIZE(msm_int_wsa_dai) +
ARRAY_SIZE(msm_int_be_dai) +
ARRAY_SIZE(msm_mi2s_be_dai_links) +
ARRAY_SIZE(msm_auxpcm_be_dai_links)+
ARRAY_SIZE(msm_wcn_be_dai_links)];
ARRAY_SIZE(msm_wcn_be_dai_links) +
ARRAY_SIZE(msm_wsa_be_dai_links)];

static struct snd_soc_card sdm660_card = {
	/* snd_soc_card_sdm660 */
@@ -2960,6 +2973,16 @@ static struct snd_soc_card *msm_int_populate_sndcard_dailinks(
	len1 = ARRAY_SIZE(msm_int_dai);
	memcpy(msm_int_dai_links, msm_int_dai, sizeof(msm_int_dai));
	dailink = msm_int_dai_links;
	if (!of_property_read_bool(dev->of_node,
				  "qcom,wsa-disable")) {
		memcpy(dailink + len1,
		       msm_int_wsa_dai,
		       sizeof(msm_int_wsa_dai));
		len1 += ARRAY_SIZE(msm_int_wsa_dai);
	}
	memcpy(dailink + len1, msm_int_be_dai, sizeof(msm_int_be_dai));
	len1 += ARRAY_SIZE(msm_int_be_dai);

	if (of_property_read_bool(dev->of_node,
				  "qcom,mi2s-audio-intf")) {
		memcpy(dailink + len1,
@@ -2982,6 +3005,12 @@ static struct snd_soc_card *msm_int_populate_sndcard_dailinks(
		       sizeof(msm_wcn_be_dai_links));
		len1 += ARRAY_SIZE(msm_wcn_be_dai_links);
	}
	if (!of_property_read_bool(dev->of_node, "qcom,wsa-disable")) {
		memcpy(dailink + len1,
		       msm_wsa_be_dai_links,
		       sizeof(msm_wsa_be_dai_links));
		len1 += ARRAY_SIZE(msm_wsa_be_dai_links);
	}
	card->dai_link = dailink;
	card->num_links = len1;
	return card;