Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion sound/soc/intel/boards/sof_sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
#include <linux/soundwire/sdw_intel.h>
#include <sound/core.h>
#include <sound/soc-acpi.h>

#include "sof_sdw_common.h"
#include "../../codecs/rt711.h"
#include "../../sof/intel/hda.h"

static unsigned long sof_sdw_quirk = RT711_JD1;
static int quirk_override = -1;
Expand Down Expand Up @@ -776,6 +778,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
},
.driver_data = (void *)(SOC_SDW_PCH_DMIC),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
DMI_MATCH(DMI_PRODUCT_NAME, "Francka"),
},
.driver_data = (void *)(SOC_SDW_CODEC_SPKR |
SOC_SDW_PCH_DMIC |
SOF_BT_OFFLOAD_SSP(2) |
SOF_SSP_BT_OFFLOAD_PRESENT),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
Expand Down Expand Up @@ -1132,8 +1145,28 @@ 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) >>
struct snd_soc_acpi_mach *mach = dev_get_platdata(dev);
const struct sof_intel_dsp_desc *chip = get_chip_info(snd_soc_card_get_drvdata(card));
int port;

if (!mach || !chip)
return -EINVAL;

port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >>
SOF_BT_OFFLOAD_SSP_SHIFT;

/* Use the bt_link_mask from module parameters if provided
* and if the SoC hardware IP version is ACE4 or newer.
* This allows platform data to override which SSP is used
* for Bluetooth offload.
*/
if (mach->mach_params.bt_link_mask &&
chip->hw_ip_version >= SOF_INTEL_ACE_4_0) {
port = __ffs(mach->mach_params.bt_link_mask);
dev_info(dev, "BT: using bt_link_mask override, SSP%d selected (ACE4+)\n",
port);
}

char *name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port);
char *cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port);
if (!name || !cpu_dai_name)
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/intel/boards/sof_sdw_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ enum {
#define SOC_SDW_NO_AGGREGATION BIT(14)

/* BT audio offload: reserve 3 bits for future */
#define SOF_BT_OFFLOAD_SSP_SHIFT 15
#define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(17, 15))
#define SOF_BT_OFFLOAD_SSP_SHIFT 18
#define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(20, 18))
#define SOF_BT_OFFLOAD_SSP(quirk) \
(((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK)
#define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18)
#define SOF_SSP_BT_OFFLOAD_PRESENT BIT(21)

struct intel_mc_ctx {
struct sof_hdmi_private hdmi;
Expand Down
35 changes: 35 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-ptl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ static const struct snd_soc_acpi_adr_device rt1320_2_group2_adr[] = {
}
};

static const struct snd_soc_acpi_adr_device rt1320_2_group2_l_adr[] = {
{
.adr = 0x000230025D132001ull,
.num_endpoints = 1,
.endpoints = &spk_l_endpoint,
.name_prefix = "rt1320-1"
}
};

static const struct snd_soc_acpi_adr_device rt1320_3_group2_adr[] = {
{
.adr = 0x000330025D132001ull,
Expand Down Expand Up @@ -531,6 +540,25 @@ static const struct snd_soc_acpi_link_adr ptl_rt722_l3[] = {
{}
};

static const struct snd_soc_acpi_link_adr ptl_rt722_l0_rt1320_l23[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt722_0_single_adr),
.adr_d = rt722_0_single_adr,
},
{
.mask = BIT(2),
.num_adr = ARRAY_SIZE(rt1320_2_group2_l_adr),
.adr_d = rt1320_2_group2_l_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt1320_3_group2_adr),
.adr_d = rt1320_3_group2_adr,
},
{}
};

static const struct snd_soc_acpi_link_adr ptl_rvp[] = {
{
.mask = BIT(0),
Expand Down Expand Up @@ -669,6 +697,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-ptl-cs42l43-l2-cs35l56x6-l13.tplg",
},
{
.link_mask = BIT(0) | BIT(2) | BIT(3),
.links = ptl_rt722_l0_rt1320_l23,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-ptl-rt722-l0-rt1320-l23.tplg",
.get_function_tplg_files = sof_sdw_get_tplg_files,
},
{
.link_mask = BIT(1) | BIT(2),
.links = ptl_sdw_rt712_vb_l2_rt1320_l1,
Expand Down