public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>,
	Liam Girdwood <liam.r.girdwood@intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
	cezary.rojewski@intel.com, liam.r.girdwood@linux.intel.com,
	peter.ujfalusi@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.dev,
	ckeepax@opensource.cirrus.com, Vijendar.Mukunda@amd.com,
	linux-sound@vger.kernel.org
Subject: [PATCH AUTOSEL 6.13 04/32] ASoC: Intel: sof_sdw: Add lookup of quirk using PCI subsystem ID
Date: Mon, 24 Feb 2025 06:16:10 -0500	[thread overview]
Message-ID: <20250224111638.2212832-4-sashal@kernel.org> (raw)
In-Reply-To: <20250224111638.2212832-1-sashal@kernel.org>

From: Richard Fitzgerald <rf@opensource.cirrus.com>

[ Upstream commit fc016ef7da64fd473d73ee6c261ba1b0b47afe2b ]

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>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250204053943.93596-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/intel/boards/sof_sdw.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 65e55c46fb064..62e71f56269d8 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -13,6 +13,7 @@
 #include <linux/soundwire/sdw.h>
 #include <linux/soundwire/sdw_type.h>
 #include <linux/soundwire/sdw_intel.h>
+#include <sound/core.h>
 #include <sound/soc-acpi.h>
 #include "sof_sdw_common.h"
 #include "../../codecs/rt711.h"
@@ -749,6 +750,22 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 	{}
 };
 
+static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
+	{}
+};
+
+static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach)
+{
+	const struct snd_pci_quirk *quirk_entry;
+
+	quirk_entry = snd_pci_quirk_lookup_id(mach->mach_params.subsystem_vendor,
+					      mach->mach_params.subsystem_device,
+					      sof_sdw_ssid_quirk_table);
+
+	if (quirk_entry)
+		sof_sdw_quirk = quirk_entry->value;
+}
+
 static struct snd_soc_dai_link_component platform_component[] = {
 	{
 		/* name might be overridden during probe */
@@ -1276,6 +1293,13 @@ static int mc_probe(struct platform_device *pdev)
 
 	snd_soc_card_set_drvdata(card, ctx);
 
+	if (mach->mach_params.subsystem_id_set) {
+		snd_soc_card_set_pci_ssid(card,
+					  mach->mach_params.subsystem_vendor,
+					  mach->mach_params.subsystem_device);
+		sof_sdw_check_ssid_quirk(mach);
+	}
+
 	dmi_check_system(sof_sdw_quirk_table);
 
 	if (quirk_override != -1) {
@@ -1291,12 +1315,6 @@ static int mc_probe(struct platform_device *pdev)
 	for (i = 0; i < ctx->codec_info_list_count; i++)
 		codec_info_list[i].amp_num = 0;
 
-	if (mach->mach_params.subsystem_id_set) {
-		snd_soc_card_set_pci_ssid(card,
-					  mach->mach_params.subsystem_vendor,
-					  mach->mach_params.subsystem_device);
-	}
-
 	ret = sof_card_dai_links_create(card);
 	if (ret < 0)
 		return ret;
-- 
2.39.5


  parent reply	other threads:[~2025-02-24 11:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 11:16 [PATCH AUTOSEL 6.13 01/32] selftests/bpf: Adjust data size to have ETH_HLEN Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 02/32] bpf: unify VM_WRITE vs VM_MAYWRITE use in BPF map mmaping logic Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 03/32] selftests/bpf: Fix invalid flag of recv() Sasha Levin
2025-02-24 11:16 ` Sasha Levin [this message]
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 05/32] ASoC: Intel: sof_sdw: Add quirk for Asus Zenbook S14 Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 06/32] ASoC: Intel: sof_sdw: Add support for Fatcat board with BT offload enabled in PTL platform Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 07/32] ASoC: Intel: soc-acpi-intel-mtl-match: declare adr as ull Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 08/32] ASoC: simple-card-utils.c: add missing dlc->of_node Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 09/32] ALSA: hda/realtek: Limit mic boost on Positivo ARN50 Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 10/32] ASoC: rsnd: indicate unsupported clock rate Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 11/32] ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime() Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 12/32] ASoC: rsnd: adjust convert rate limitation Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 13/32] ASoC: arizona/madera: use fsleep() in up/down DAPM event delays Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 14/32] ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 15/32] PCI: pci_ids: add INTEL_HDA_PTL_H Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 16/32] ALSA: hda: intel-dsp-config: Add PTL-H support Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 17/32] ASoC: SOF: Intel: pci-ptl: Add support for PTL-H Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 18/32] ALSA: hda: hda-intel: add Panther Lake-H support Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 19/32] ASoC: SOF: amd: Add post_fw_run_delay ACP quirk Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 20/32] ASoC: SOF: amd: Handle IPC replies before FW_BOOT_COMPLETE Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 21/32] net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 22/32] io-wq: backoff when retrying worker creation Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 23/32] nvme-pci: quirk Acer FA100 for non-uniqueue identifiers Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 24/32] nvme-tcp: add basic support for the C2HTermReq PDU Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 25/32] nvmet-rdma: recheck queue state is LIVE in state lock in recv done Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 26/32] apple-nvme: Release power domains when probe fails Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 27/32] drm/xe: Make GUC binaries dump consistent with other binaries in devcoredump Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 28/32] cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point() Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 29/32] cifs: Treat unhandled directory name surrogate reparse points as mount directory nodes Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 30/32] sctp: Fix undefined behavior in left shift operation Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 31/32] nvme: only allow entering LIVE from CONNECTING state Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 32/32] irqchip/qcom-pdc: Workaround hardware register bug on X1E80100 Sasha Levin
2025-02-24 14:46   ` Johan Hovold
2025-03-15  1:30     ` Sasha Levin

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=20250224111638.2212832-4-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=rf@opensource.cirrus.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /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