From 7e300730037f4fd5d8b308cb9c5467d1338b3e86 Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Wed, 8 Jun 2022 00:01:26 -0700 Subject: asoc: kalama: add boolean flag for adding swr haptics dai-links Change-Id: I460aa6baa015b79fd6b74bb8ac8827a5b82d34ea --- asoc/kalama.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'asoc/kalama.c') diff --git a/asoc/kalama.c b/asoc/kalama.c index 253e94ba..d4dfd503 100644 --- a/asoc/kalama.c +++ b/asoc/kalama.c @@ -500,6 +500,20 @@ static struct snd_soc_dai_link msm_common_be_dai_links[] = { }, }; +static struct snd_soc_dai_link msm_swr_haptics_be_dai_links[] = { + { + .name = LPASS_BE_RX_CDC_DMA_RX_6, + .stream_name = LPASS_BE_RX_CDC_DMA_RX_6, + .playback_only = 1, + .trigger = {SND_SOC_DPCM_TRIGGER_POST, + SND_SOC_DPCM_TRIGGER_POST}, + .ignore_pmdown_time = 1, + .ignore_suspend = 1, + .ops = &msm_common_be_ops, + SND_SOC_DAILINK_REG(rx_dma_rx6), + }, +}; + static struct snd_soc_dai_link msm_wcn_be_dai_links[] = { { .name = LPASS_BE_SLIMBUS_7_RX, @@ -774,17 +788,6 @@ static struct snd_soc_dai_link msm_rx_tx_cdc_dma_be_dai_links[] = { .ops = &msm_common_be_ops, SND_SOC_DAILINK_REG(rx_dma_rx5), }, - { - .name = LPASS_BE_RX_CDC_DMA_RX_6, - .stream_name = LPASS_BE_RX_CDC_DMA_RX_6, - .playback_only = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, - SND_SOC_DPCM_TRIGGER_POST}, - .ignore_pmdown_time = 1, - .ignore_suspend = 1, - .ops = &msm_common_be_ops, - SND_SOC_DAILINK_REG(rx_dma_rx6), - }, /* TX CDC DMA Backend DAI Links */ { .name = LPASS_BE_TX_CDC_DMA_TX_3, @@ -1463,6 +1466,15 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev, int w sizeof(msm_wcn_be_dai_links)); total_links += ARRAY_SIZE(msm_wcn_be_dai_links); } + if (of_find_property(dev->of_node, "swr-haptics-unsupported", + NULL)) { + dev_dbg(dev, "%s(): swr haptics support not present\n", __func__); + } else { + memcpy(msm_kalama_dai_links + total_links, + msm_swr_haptics_be_dai_links, + sizeof(msm_swr_haptics_be_dai_links)); + total_links += ARRAY_SIZE(msm_swr_haptics_be_dai_links); + } dailink = msm_kalama_dai_links; } else if(!strcmp(match->data, "stub_codec")) { -- cgit v1.2.3