All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
	Mark Brown <broonie@kernel.org>
Subject: [alsa-devel] Applied "ASoC: SOF: Intel: byt: fixup topology filename for BYT-CR" to the asoc tree
Date: Tue, 10 Dec 2019 13:22:29 +0000	[thread overview]
Message-ID: <applied-20191210004854.16845-8-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20191210004854.16845-8-pierre-louis.bossart@linux.intel.com>

The patch

   ASoC: SOF: Intel: byt: fixup topology filename for BYT-CR

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 2aae447a4c100d2a7b7cae26b1df8b329e730d8b Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Mon, 9 Dec 2019 18:48:53 -0600
Subject: [PATCH] ASoC: SOF: Intel: byt: fixup topology filename for BYT-CR

On Baytrail-CR, SSP0 needs to be used instead of SSP2.  The
substitution is assumed to be done in the topology file.

When Baytrail-CR is detected, add -ssp0 suffix to the topology file
name so that the topology code picks up the correct file.

Tested on Asus T100TAF

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191210004854.16845-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/intel/byt.c | 47 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c
index 2f5db1a8c701..ec6ca863243c 100644
--- a/sound/soc/sof/intel/byt.c
+++ b/sound/soc/sof/intel/byt.c
@@ -18,6 +18,7 @@
 #include "../ops.h"
 #include "shim.h"
 #include "../sof-audio.h"
+#include "../../intel/common/soc-intel-quirks.h"
 
 /* DSP memories */
 #define IRAM_OFFSET		0x0C0000
@@ -383,11 +384,37 @@ static int byt_reset(struct snd_sof_dev *sdev)
 	return 0;
 }
 
+static const char *fixup_tplg_name(struct snd_sof_dev *sdev,
+				   const char *sof_tplg_filename,
+				   const char *ssp_str)
+{
+	const char *tplg_filename = NULL;
+	char *filename;
+	char *split_ext;
+
+	filename = devm_kstrdup(sdev->dev, sof_tplg_filename, GFP_KERNEL);
+	if (!filename)
+		return NULL;
+
+	/* this assumes a .tplg extension */
+	split_ext = strsep(&filename, ".");
+	if (split_ext) {
+		tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL,
+					       "%s-%s.tplg",
+					       split_ext, ssp_str);
+		if (!tplg_filename)
+			return NULL;
+	}
+	return tplg_filename;
+}
+
 static void byt_machine_select(struct snd_sof_dev *sdev)
 {
 	struct snd_sof_pdata *sof_pdata = sdev->pdata;
 	const struct sof_dev_desc *desc = sof_pdata->desc;
 	struct snd_soc_acpi_mach *mach;
+	struct platform_device *pdev;
+	const char *tplg_filename;
 
 	mach = snd_soc_acpi_find_machine(desc->machines);
 	if (!mach) {
@@ -395,7 +422,25 @@ static void byt_machine_select(struct snd_sof_dev *sdev)
 		return;
 	}
 
-	sof_pdata->tplg_filename = mach->sof_tplg_filename;
+	pdev = to_platform_device(sdev->dev);
+	if (soc_intel_is_byt_cr(pdev)) {
+		dev_dbg(sdev->dev,
+			"BYT-CR detected, SSP0 used instead of SSP2\n");
+
+		tplg_filename = fixup_tplg_name(sdev,
+						mach->sof_tplg_filename,
+						"ssp0");
+	} else {
+		tplg_filename = mach->sof_tplg_filename;
+	}
+
+	if (!tplg_filename) {
+		dev_dbg(sdev->dev,
+			"error: no topology filename\n");
+		return;
+	}
+
+	sof_pdata->tplg_filename = tplg_filename;
 	mach->mach_params.acpi_ipc_irq_index = desc->irqindex_host_ipc;
 	sof_pdata->machine = mach;
 }
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-12-10 13:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10  0:48 [alsa-devel] [PATCH 0/8] ASoC: SOF: improvements for v5.6 Pierre-Louis Bossart
2019-12-10  0:48 ` [alsa-devel] [PATCH 1/8] ASoC: SOF: Add asynchronous sample rate converter topology support Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: SOF: Add asynchronous sample rate converter topology support" to the asoc tree Mark Brown
2019-12-10  0:48 ` [alsa-devel] [PATCH 2/8] ASoC: SOF: loader: snd_sof_fw_parse_ext_data log warning on unknown header Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: SOF: loader: snd_sof_fw_parse_ext_data log warning on unknown header" to the asoc tree Mark Brown
2019-12-10  0:48 ` [alsa-devel] [PATCH 3/8] ASoC: SOF: loader: fix snd_sof_fw_parse_ext_data Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: SOF: loader: fix snd_sof_fw_parse_ext_data" to the asoc tree Mark Brown
2019-12-10  0:48 ` [alsa-devel] [PATCH 4/8] ASoC: SOF: ipc: channel map structures Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: SOF: ipc: channel map structures" to the asoc tree Mark Brown
2019-12-10  0:48 ` [alsa-devel] [PATCH 5/8] ASoC: SOF: Intel: add codec_mask module parameter Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: SOF: Intel: add codec_mask module parameter" to the asoc tree Mark Brown
2019-12-10  0:48 ` [alsa-devel] [PATCH 6/8] ASoC: SOF: Intel: split cht and byt debug window sizes Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: SOF: Intel: split cht and byt debug window sizes" to the asoc tree Mark Brown
2019-12-10  0:48 ` [alsa-devel] [PATCH 7/8] ASoC: SOF: Intel: byt: fixup topology filename for BYT-CR Pierre-Louis Bossart
2019-12-10 13:22   ` Mark Brown [this message]
2019-12-10  0:48 ` [alsa-devel] [PATCH 8/8] ASoC: Intel: common: work-around incorrect ACPI HID for CML boards Pierre-Louis Bossart
2019-12-10 13:23   ` [alsa-devel] Applied "ASoC: Intel: common: work-around incorrect ACPI HID for CML boards" to the asoc tree 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=applied-20191210004854.16845-8-pierre-louis.bossart@linux.intel.com \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /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.