From df5f5edaef4b653fa731dcf3753e71766f95c2cd Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 12 Nov 2020 16:38:19 -0600
Subject: [PATCH] ASoC: Intel: Atom: add dynamic selection of DSP driver
Git-commit: df5f5edaef4b653fa731dcf3753e71766f95c2cd
Patch-mainline: v5.11-rc1
References: jsc#SLE-16518
Follow PCI example and stop the probe when another driver is desired
for the same ACPI HID.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
sound/soc/intel/Kconfig | 1 +
sound/soc/intel/atom/sst/sst_acpi.c | 8 ++++++++
2 files changed, 9 insertions(+)
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -99,6 +99,7 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
select SND_SST_IPC_ACPI
select SND_SST_ATOM_HIFI2_PLATFORM
select SND_SOC_ACPI_INTEL_MATCH
+ select SND_INTEL_DSP_CONFIG
select IOSF_MBI
help
If you have a Intel Baytrail or Cherrytrail platform with an I2S
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -21,6 +21,7 @@
#include <linux/acpi.h>
#include <asm/platform_sst_audio.h>
#include <sound/core.h>
+#include <sound/intel-dsp-config.h>
#include <sound/soc.h>
#include <sound/compress_driver.h>
#include <acpi/acbuffer.h>
@@ -247,6 +248,13 @@ static int sst_acpi_probe(struct platfor
id = acpi_match_device(dev->driver->acpi_match_table, dev);
if (!id)
return -ENODEV;
+
+ ret = snd_intel_acpi_dsp_driver_probe(dev, id->id);
+ if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SST) {
+ dev_dbg(dev, "SST ACPI driver not selected, aborting probe\n");
+ return -ENODEV;
+ }
+
dev_dbg(dev, "for %s\n", id->id);
mach = (struct snd_soc_acpi_mach *)id->driver_data;