From: Bard Liao <yung-chuan.liao@linux.intel.com>
To: broonie@kernel.org, tiwai@suse.de
Cc: linux-sound@vger.kernel.org, bard.liao@intel.com
Subject: [PATCH 4/6] ASoC: Intel: sof_sdw: create BT dai link if bt_link_mask is set
Date: Tue, 11 Nov 2025 20:37:35 +0800 [thread overview]
Message-ID: <20251111123737.246626-5-yung-chuan.liao@linux.intel.com> (raw)
In-Reply-To: <20251111123737.246626-1-yung-chuan.liao@linux.intel.com>
The bt_link_mask value is from NHLT. The BT dai link should be created
if bt_link_mask is set. Besides, hda_machine_select() will look for the
topology with BT BE.
Suggested-by: Mac Chiang <mac.chiang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
sound/soc/intel/boards/sof_sdw.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index a7f39b83bef7..cb57c5b3a2dc 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -1138,15 +1138,22 @@ static int create_bt_dailinks(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links, int *be_id)
{
struct device *dev = card->dev;
- int port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >>
- SOF_BT_OFFLOAD_SSP_SHIFT;
- char *name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port);
- char *cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port);
+ struct snd_soc_acpi_mach *mach = dev_get_platdata(dev);
+ char *cpu_dai_name;
+ char *name;
+ int port;
+ int ret;
+
+ if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
+ port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> SOF_BT_OFFLOAD_SSP_SHIFT;
+ else
+ port = fls(mach->mach_params.bt_link_mask) - 1;
+
+ name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port);
+ cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port);
if (!name || !cpu_dai_name)
return -ENOMEM;
- int ret;
-
ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
1, 1, cpu_dai_name, "dummy",
snd_soc_dummy_dlc.name, snd_soc_dummy_dlc.dai_name,
@@ -1243,7 +1250,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
mach_params->dmic_num = DMIC_DEFAULT_CHANNELS;
}
- if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
+ if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT || mach_params->bt_link_mask)
bt_num = 1;
dev_dbg(dev, "DAI link numbers: sdw %d, ssp %d, dmic %d, hdmi %d, bt: %d\n",
@@ -1298,7 +1305,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
goto err_end;
/* BT */
- if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) {
+ if (bt_num) {
ret = create_bt_dailinks(card, &dai_links, &be_id);
if (ret)
goto err_end;
--
2.43.0
next prev parent reply other threads:[~2025-11-11 12:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 12:37 [PATCH 0/6] ASoC: Intel: machine driver updates for 6.19 Bard Liao
2025-11-11 12:37 ` [PATCH 1/6] ASoC: Intel: soc-acpi-intel-ptl-match: Add support for rt722_l0_rt1320_l23 Bard Liao
2025-11-11 12:37 ` [PATCH 2/6] ASoC: Intel: sof_sdw: Add quirk to exclude RT722 speaker Bard Liao
2025-11-11 12:37 ` [PATCH 3/6] ASOC: Intel: sof_sdw: add quirk for Avell B.ON (OEM rebranded NUC15) Bard Liao
2025-11-11 12:37 ` Bard Liao [this message]
2025-11-11 12:37 ` [PATCH 5/6] ASoC: Intel: soc-acpi-ptl-match: add cs42l43_agg_l3_cs35l56_2 support Bard Liao
2025-11-11 12:37 ` [PATCH 6/6] ASoC: Intel: sof_sdw: add codec speaker support for the SKU Bard Liao
2025-11-11 21:10 ` [PATCH 0/6] ASoC: Intel: machine driver updates for 6.19 Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251111123737.246626-5-yung-chuan.liao@linux.intel.com \
--to=yung-chuan.liao@linux.intel.com \
--cc=bard.liao@intel.com \
--cc=broonie@kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox