Skip to content

Commit fc016ef

Browse files
rfvirgilbroonie
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 <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent a8c9a45 commit fc016ef

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

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"
@@ -751,6 +752,22 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
751752
{}
752753
};
753754

755+
static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
756+
{}
757+
};
758+
759+
static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach)
760+
{
761+
const struct snd_pci_quirk *quirk_entry;
762+
763+
quirk_entry = snd_pci_quirk_lookup_id(mach->mach_params.subsystem_vendor,
764+
mach->mach_params.subsystem_device,
765+
sof_sdw_ssid_quirk_table);
766+
767+
if (quirk_entry)
768+
sof_sdw_quirk = quirk_entry->value;
769+
}
770+
754771
static struct snd_soc_dai_link_component platform_component[] = {
755772
{
756773
/* name might be overridden during probe */
@@ -1278,6 +1295,13 @@ static int mc_probe(struct platform_device *pdev)
12781295

12791296
snd_soc_card_set_drvdata(card, ctx);
12801297

1298+
if (mach->mach_params.subsystem_id_set) {
1299+
snd_soc_card_set_pci_ssid(card,
1300+
mach->mach_params.subsystem_vendor,
1301+
mach->mach_params.subsystem_device);
1302+
sof_sdw_check_ssid_quirk(mach);
1303+
}
1304+
12811305
dmi_check_system(sof_sdw_quirk_table);
12821306

12831307
if (quirk_override != -1) {
@@ -1293,12 +1317,6 @@ static int mc_probe(struct platform_device *pdev)
12931317
for (i = 0; i < ctx->codec_info_list_count; i++)
12941318
codec_info_list[i].amp_num = 0;
12951319

1296-
if (mach->mach_params.subsystem_id_set) {
1297-
snd_soc_card_set_pci_ssid(card,
1298-
mach->mach_params.subsystem_vendor,
1299-
mach->mach_params.subsystem_device);
1300-
}
1301-
13021320
ret = sof_card_dai_links_create(card);
13031321
if (ret < 0)
13041322
return ret;

0 commit comments

Comments
 (0)