Skip to content

Commit 04b4366

Browse files
rfvirgilbardliao
authored andcommitted
ASoC: Intel: sof_sdw: Add lookup of quirk using PCI subsystem ID
Add lookup of PCI subsystem vendor:device ID to find a quirk. The subsystem ID (SSID) is part of the PCI specification to uniquely identify a particular system-specific implementation of a hardware device. Unlike DMI information, it identifies the sound hardware itself, rather than a specific model of PC. SSID can be more reliable and stable than DMI strings, and is preferred by some vendors as the way to identify the actual sound hardware. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
1 parent 50e829c commit 04b4366

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

sound/soc/intel/boards/sof_sdw.c

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/soundwire/sdw.h>
1414
#include <linux/soundwire/sdw_type.h>
1515
#include <linux/soundwire/sdw_intel.h>
16+
#include <sound/core.h>
1617
#include <sound/soc-acpi.h>
1718
#include "sof_sdw_common.h"
1819
#include "../../codecs/rt711.h"
@@ -770,6 +771,22 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
770771
{}
771772
};
772773

774+
static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
775+
{}
776+
};
777+
778+
static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach)
779+
{
780+
const struct snd_pci_quirk *quirk_entry;
781+
782+
quirk_entry = snd_pci_quirk_lookup_id(mach->mach_params.subsystem_vendor,
783+
mach->mach_params.subsystem_device,
784+
sof_sdw_ssid_quirk_table);
785+
786+
if (quirk_entry)
787+
sof_sdw_quirk = quirk_entry->value;
788+
}
789+
773790
static struct snd_soc_dai_link_component platform_component[] = {
774791
{
775792
/* name might be overridden during probe */
@@ -1297,6 +1314,13 @@ static int mc_probe(struct platform_device *pdev)
12971314

12981315
snd_soc_card_set_drvdata(card, ctx);
12991316

1317+
if (mach->mach_params.subsystem_id_set) {
1318+
snd_soc_card_set_pci_ssid(card,
1319+
mach->mach_params.subsystem_vendor,
1320+
mach->mach_params.subsystem_device);
1321+
sof_sdw_check_ssid_quirk(mach);
1322+
}
1323+
13001324
dmi_check_system(sof_sdw_quirk_table);
13011325

13021326
if (quirk_override != -1) {
@@ -1312,12 +1336,6 @@ static int mc_probe(struct platform_device *pdev)
13121336
for (i = 0; i < ctx->codec_info_list_count; i++)
13131337
codec_info_list[i].amp_num = 0;
13141338

1315-
if (mach->mach_params.subsystem_id_set) {
1316-
snd_soc_card_set_pci_ssid(card,
1317-
mach->mach_params.subsystem_vendor,
1318-
mach->mach_params.subsystem_device);
1319-
}
1320-
13211339
ret = sof_card_dai_links_create(card);
13221340
if (ret < 0)
13231341
return ret;

0 commit comments

Comments
 (0)