ASoC: amd: acp: Add new cpu dai and dailink creation for I2S BT instance
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>
Wed, 6 Dec 2023 11:06:15 +0000 (16:36 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 6 Dec 2023 19:10:03 +0000 (19:10 +0000)
Add sof_bt cpu id and create dailink for i2s bt instance in
acp common machine driver.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp/acp-mach-common.c
sound/soc/amd/acp/acp-mach.h

index 34b14f2611ba816df86e91ed16b1e28dcbd6fdf8..4631af028f1577c6c6200d9a5023a2bd78dce688 100644 (file)
@@ -3,7 +3,7 @@
 // This file is provided under a dual BSD/GPLv2 license. When using or
 // redistributing this file, you may do so under either license.
 //
-// Copyright(c) 2021 Advanced Micro Devices, Inc.
+// Copyright(c) 2021, 2023 Advanced Micro Devices, Inc.
 //
 // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
 //         Vijendar Mukunda <Vijendar.Mukunda@amd.com>
@@ -1290,6 +1290,8 @@ SND_SOC_DAILINK_DEF(sof_hs,
                    DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs")));
 SND_SOC_DAILINK_DEF(sof_hs_virtual,
        DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs-virtual")));
+SND_SOC_DAILINK_DEF(sof_bt,
+                   DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-bt")));
 SND_SOC_DAILINK_DEF(sof_dmic,
        DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-dmic")));
 SND_SOC_DAILINK_DEF(pdm_dmic,
@@ -1348,6 +1350,8 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
 
        if (drv_data->hs_cpu_id)
                num_links++;
+       if (drv_data->bt_cpu_id)
+               num_links++;
        if (drv_data->amp_cpu_id)
                num_links++;
        if (drv_data->dmic_cpu_id)
@@ -1497,6 +1501,25 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
                i++;
        }
 
+       if (drv_data->bt_cpu_id == I2S_BT) {
+               links[i].name = "acp-bt-codec";
+               links[i].id = BT_BE_ID;
+               links[i].cpus = sof_bt;
+               links[i].num_cpus = ARRAY_SIZE(sof_bt);
+               links[i].platforms = sof_component;
+               links[i].num_platforms = ARRAY_SIZE(sof_component);
+               links[i].dpcm_playback = 1;
+               links[i].dpcm_capture = 1;
+               links[i].nonatomic = true;
+               links[i].no_pcm = 1;
+               if (!drv_data->bt_codec_id) {
+                       /* Use dummy codec if codec id not specified */
+                       links[i].codecs = &snd_soc_dummy_dlc;
+                       links[i].num_codecs = 1;
+               }
+               i++;
+       }
+
        if (drv_data->dmic_cpu_id == DMIC) {
                links[i].name = "acp-dmic-codec";
                links[i].id = DMIC_BE_ID;
index cd681101bea738646d882b2f43f62f14b9d0f085..a48546d8d40732a4d91ea6e585db5f253afa080d 100644 (file)
@@ -28,6 +28,7 @@ enum be_id {
        HEADSET_BE_ID = 0,
        AMP_BE_ID,
        DMIC_BE_ID,
+       BT_BE_ID,
 };
 
 enum cpu_endpoints {
@@ -68,9 +69,11 @@ struct acp_mach_ops {
 struct acp_card_drvdata {
        unsigned int hs_cpu_id;
        unsigned int amp_cpu_id;
+       unsigned int bt_cpu_id;
        unsigned int dmic_cpu_id;
        unsigned int hs_codec_id;
        unsigned int amp_codec_id;
+       unsigned int bt_codec_id;
        unsigned int dmic_codec_id;
        unsigned int dai_fmt;
        unsigned int platform;