From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C76324BC05; Mon, 24 Feb 2025 11:16:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740395811; cv=none; b=AiyRRXebMFotywHzgNl4ffhqFlYVZxuhfenJQxj7q6B5PKB0GAdvdHglJOrIwmGL1XdEJFdlSRtmGcwHwQZ5NNjVOYRcroIT186QrxUDw57S96b54Jj3l1Ku+fc9kqhynnh4w/l/il9PC6bp981RYml889tt681AFxacwwcCZfQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740395811; c=relaxed/simple; bh=ORWuvybuN31lbTRPvYVJ6fBUcYskFjGCVci229SNWGw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T2tI5PgrqCLlVxe+MyFTND1LQVpfFU2ADJnvJkk4aNuCJ3V2SifMrSdF2CkLtsWPaJG3GRU+1WCitp2TqsmjtpZ4wadx+FN8QyY6AryDlbNi7OtkkuppZ/EizCujw7OBQi56+Ej7GQR9tGtG6P8vXzVpcCSpNIrUiSVDvLKX6T8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mu3fh5lJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mu3fh5lJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5472C4AF0B; Mon, 24 Feb 2025 11:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740395810; bh=ORWuvybuN31lbTRPvYVJ6fBUcYskFjGCVci229SNWGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mu3fh5lJvsIBSPVwsjOu85mz8g4jr/XrT7Of9n94B2j8014goyiTRFhHjtY5AsbDW v9hL90CrhJNR4NgYrA1eIBV8JgOnL3eEz05xveEjvPPI17MN3Y2ecN3LvQNPSO6VRm NqRObEOE5NbZ29T6IdhTxzGmC+x302suLKiaNcu4aJPn2l7hC9y7X4yoZ6JEtdWy8v TVgqQQzg1nETM4FHdbF0fG/hq1hSn/CSmnvFtTKWZ7y2cUMDYCeSUKa14R1Yl444c1 z7NFxYDNJu5XTlne+q4fYE1yfRTLCHttPTrzXs03SinxreZKxcdxqDiP/DTmWtE+BD y+0Go5KbsIdfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Richard Fitzgerald , Liam Girdwood , Bard Liao , Mark Brown , Sasha Levin , 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 Message-Id: <20250224111638.2212832-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250224111638.2212832-1-sashal@kernel.org> References: <20250224111638.2212832-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.13.4 Content-Transfer-Encoding: 8bit From: Richard Fitzgerald [ 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 Reviewed-by: Liam Girdwood Signed-off-by: Bard Liao Link: https://patch.msgid.link/20250204053943.93596-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 #include #include +#include #include #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