Skip to content

Commit af0aefc

Browse files
macchianbardliao
authored andcommitted
ASoC: Intel: sof_sdw: create SSP BT DAI if bt_link_mask sets
This patch adds support for selecting the SSP DAI for Bluetooth offload based on the machine parameter `bt_link_mask` when provided and on ACE4 or newer Intel SoCs. This allows platform data to override which SSP port is used for BT offload topologies, typically named: sof_tplg_filename"-%dch"-ssp%d-bt.tplg Signed-off-by: Mac Chiang <mac.chiang@intel.com>
1 parent 8e8ca86 commit af0aefc

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

sound/soc/intel/boards/sof_sdw.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
#include <linux/soundwire/sdw_intel.h>
1616
#include <sound/core.h>
1717
#include <sound/soc-acpi.h>
18+
1819
#include "sof_sdw_common.h"
1920
#include "../../codecs/rt711.h"
21+
#include "../../sof/intel/hda.h"
2022

2123
static unsigned long sof_sdw_quirk = RT711_JD1;
2224
static int quirk_override = -1;
@@ -1143,8 +1145,28 @@ static int create_bt_dailinks(struct snd_soc_card *card,
11431145
struct snd_soc_dai_link **dai_links, int *be_id)
11441146
{
11451147
struct device *dev = card->dev;
1146-
int port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >>
1148+
struct snd_soc_acpi_mach *mach = dev_get_platdata(dev);
1149+
const struct sof_intel_dsp_desc *chip = get_chip_info(snd_soc_card_get_drvdata(card));
1150+
int port;
1151+
1152+
if (!mach || !chip)
1153+
return -EINVAL;
1154+
1155+
port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >>
11471156
SOF_BT_OFFLOAD_SSP_SHIFT;
1157+
1158+
/* Use the bt_link_mask from module parameters if provided
1159+
* and if the SoC hardware IP version is ACE4 or newer.
1160+
* This allows platform data to override which SSP is used
1161+
* for Bluetooth offload.
1162+
*/
1163+
if (mach->mach_params.bt_link_mask &&
1164+
chip->hw_ip_version >= SOF_INTEL_ACE_4_0) {
1165+
port = __ffs(mach->mach_params.bt_link_mask);
1166+
dev_info(dev, "BT: using bt_link_mask override, SSP%d selected (ACE4+)\n",
1167+
port);
1168+
}
1169+
11481170
char *name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port);
11491171
char *cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port);
11501172
if (!name || !cpu_dai_name)

0 commit comments

Comments
 (0)