All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	vinod.koul@intel.com, broonie@kernel.org,
	Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>,
	Bard liao <yung-chuan.liao@linux.intel.com>,
	Rander Wang <rander.wang@linux.intel.com>
Subject: [PATCH 12/14] ASoC: SOF: Add topology filename override based on dmi data match
Date: Fri, 21 Aug 2020 14:56:00 -0500	[thread overview]
Message-ID: <20200821195603.215535-14-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200821195603.215535-1-pierre-louis.bossart@linux.intel.com>

From: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>

Add topology filename override based on system DMI data matching,
typically to account for a different hardware layout.

In ACPI based systems, the tplg_filename is pre-defined in an ACPI
machine table. When a DMI quirk is detected, the
sof_pdata->tplg_filename is not set with the hard-coded ACPI value,
and instead is set with the DMI-specific filename.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/intel/hda.c   |  8 +++++++-
 sound/soc/sof/sof-pci-dev.c | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index c0b75d682750..b8157c1f37f3 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1179,7 +1179,13 @@ void hda_machine_select(struct snd_sof_dev *sdev)
 
 	mach = snd_soc_acpi_find_machine(desc->machines);
 	if (mach) {
-		sof_pdata->tplg_filename = mach->sof_tplg_filename;
+		/*
+		 * If tplg file name is overridden, use it instead of
+		 * the one set in mach table
+		 */
+		if (!sof_pdata->tplg_filename)
+			sof_pdata->tplg_filename = mach->sof_tplg_filename;
+
 		sof_pdata->machine = mach;
 
 		if (mach->link_mask) {
diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index aa3532ba1434..f3a8140773db 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -35,8 +35,28 @@ static int sof_pci_debug;
 module_param_named(sof_pci_debug, sof_pci_debug, int, 0444);
 MODULE_PARM_DESC(sof_pci_debug, "SOF PCI debug options (0x0 all off)");
 
+static const char *sof_override_tplg_name;
+
 #define SOF_PCI_DISABLE_PM_RUNTIME BIT(0)
 
+static int sof_tplg_cb(const struct dmi_system_id *id)
+{
+	sof_override_tplg_name = id->driver_data;
+	return 1;
+}
+
+static const struct dmi_system_id sof_tplg_table[] = {
+	{
+		.callback = sof_tplg_cb,
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Volteer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Terrador"),
+		},
+		.driver_data = "sof-tgl-rt5682-ssp0-max98373-ssp2.tplg",
+	},
+	{}
+};
+
 static const struct dmi_system_id community_key_platforms[] = {
 	{
 		.ident = "Up Squared",
@@ -347,6 +367,10 @@ static int sof_pci_probe(struct pci_dev *pci,
 		sof_pdata->tplg_filename_prefix =
 			sof_pdata->desc->default_tplg_path;
 
+	dmi_check_system(sof_tplg_table);
+	if (sof_override_tplg_name)
+		sof_pdata->tplg_filename = sof_override_tplg_name;
+
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
 	/* set callback to enable runtime_pm */
 	sof_pdata->sof_probe_complete = sof_pci_probe_complete;
-- 
2.25.1


  parent reply	other threads:[~2020-08-21 20:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 19:55 [PATCH 00/14] ASoC: Intel: machine driver updates for 5.10 Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 01/14] ASoC: Intel: modify SoundWire version id in acpi match table Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 02/14] ASoC: Intel: soc-acpi: cnl: add support for rt5682 on SoundWire link2 Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 03/14] ASoC: Intel: sof-soundwire: add support for rt5682 on link2 Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 04/14] ASoC: Intel: soc-acpi: mirror CML and TGL configurations Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 05/14] ASoC: Intel: soc-acpi: add support for SDCA boards Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 06/14] ASoC: Intel: tgl_max98373: fix a runtime pm issue in multi-thread case Pierre-Louis Bossart
2020-08-21 21:55   ` Mark Brown
2020-08-24 14:24     ` Pierre-Louis Bossart
2020-08-24 18:56       ` Mark Brown
2020-08-21 19:55 ` [PATCH 07/14] ASoC: codecs: max98373-sdw: add missing test on resume Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 08/14] ASoC: Intel: sof_sdw: check SoundWire version when matching codec Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 09/14] ASoC: Intel: sof_sdw: rename id as part_id Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 10/14] ASoC: Intel: sof_sdw: Add support for product Ripto Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 10/14] SoC: " Pierre-Louis Bossart
2020-08-21 19:55 ` [PATCH 11/14] ASoC: Intel: sof_rt5682: override quirk data for tgl_max98373_rt5682 Pierre-Louis Bossart
2020-08-21 19:56 ` Pierre-Louis Bossart [this message]
2020-08-21 19:56 ` [PATCH 13/14] ASoC: intel: sof_sdw: add rt711 rt1316 rt714 SDCA codec support Pierre-Louis Bossart
2020-08-21 19:56 ` [PATCH 13/14] ASoC: Intel: " Pierre-Louis Bossart
2020-08-21 19:56 ` [PATCH 14/14] ASoC: Intel: sof_sdw: clean-up inclusion of header files Pierre-Louis Bossart
2020-08-24 13:31 ` [PATCH 00/14] ASoC: Intel: machine driver updates for 5.10 Mark Brown
2020-08-24 19:16 ` Mark Brown

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=20200821195603.215535-14-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=rander.wang@linux.intel.com \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.