From e1dc0d79011e467762d4e3f4da06c573388efbba Mon Sep 17 00:00:00 2001 From: Laxminath Kasam Date: Tue, 5 Nov 2019 21:19:45 +0530 Subject: [PATCH] asoc: bengal: Use dtsi property for VA, RX-TX macros dailinks Append dailinks for VA and RX-TX macros based on dtsi property. Change-Id: Ib1f4520cd569546e5954d9295b8455f89a3212ca Signed-off-by: Laxminath Kasam --- asoc/bengal.c | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/asoc/bengal.c b/asoc/bengal.c index 21287b408f92..c500a178f350 100644 --- a/asoc/bengal.c +++ b/asoc/bengal.c @@ -5833,6 +5833,8 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev) int rc = 0; u32 mi2s_audio_intf = 0; u32 auxpcm_audio_intf = 0; + u32 rxtx_bolero_codec = 0; + u32 va_bolero_codec = 0; u32 val = 0; u32 wcn_btfm_intf = 0; const struct of_device_id *match; @@ -5862,17 +5864,37 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev) sizeof(msm_common_be_dai_links)); total_links += ARRAY_SIZE(msm_common_be_dai_links); - memcpy(msm_bengal_dai_links + total_links, - msm_rx_tx_cdc_dma_be_dai_links, - sizeof(msm_rx_tx_cdc_dma_be_dai_links)); - total_links += - ARRAY_SIZE(msm_rx_tx_cdc_dma_be_dai_links); + rc = of_property_read_u32(dev->of_node, + "qcom,rxtx-bolero-codec", + &rxtx_bolero_codec); + if (rc) { + dev_dbg(dev, "%s: No DT match RXTX Macro codec\n", + __func__); + } else { + if (rxtx_bolero_codec) { + memcpy(msm_bengal_dai_links + total_links, + msm_rx_tx_cdc_dma_be_dai_links, + sizeof(msm_rx_tx_cdc_dma_be_dai_links)); + total_links += + ARRAY_SIZE( + msm_rx_tx_cdc_dma_be_dai_links); + } + } - memcpy(msm_bengal_dai_links + total_links, - msm_va_cdc_dma_be_dai_links, - sizeof(msm_va_cdc_dma_be_dai_links)); - total_links += - ARRAY_SIZE(msm_va_cdc_dma_be_dai_links); + rc = of_property_read_u32(dev->of_node, "qcom,va-bolero-codec", + &va_bolero_codec); + if (rc) { + dev_dbg(dev, "%s: No DT match VA Macro codec\n", + __func__); + } else { + if (va_bolero_codec) { + memcpy(msm_bengal_dai_links + total_links, + msm_va_cdc_dma_be_dai_links, + sizeof(msm_va_cdc_dma_be_dai_links)); + total_links += + ARRAY_SIZE(msm_va_cdc_dma_be_dai_links); + } + } rc = of_property_read_u32(dev->of_node, "qcom,mi2s-audio-intf", &mi2s_audio_intf);