summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/catpt/device.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2020-11-12 16:38:23 -0600
committerMark Brown <broonie@kernel.org>2020-11-19 18:24:43 +0000
commitec8a15d3a7c7d6e9acd2e0637d2020ac17fb7820 (patch)
tree534ebf6a50a61792a396f3e90382f853d7ac3892 /sound/soc/intel/catpt/device.c
parent8643e85aab878fe0d8031ae4622b40cfb78d4172 (diff)
downloadlinux-stable-ec8a15d3a7c7d6e9acd2e0637d2020ac17fb7820.tar.gz
linux-stable-ec8a15d3a7c7d6e9acd2e0637d2020ac17fb7820.tar.bz2
linux-stable-ec8a15d3a7c7d6e9acd2e0637d2020ac17fb7820.zip
ASoC: Intel: catpt: add dynamic selection of DSP driver
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-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/catpt/device.c')
-rw-r--r--sound/soc/intel/catpt/device.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/intel/catpt/device.c b/sound/soc/intel/catpt/device.c
index b1d380868d8c..85a34e37316d 100644
--- a/sound/soc/intel/catpt/device.c
+++ b/sound/soc/intel/catpt/device.c
@@ -19,6 +19,7 @@
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <sound/intel-dsp-config.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/soc-acpi-intel-match.h>
@@ -239,9 +240,20 @@ static int catpt_acpi_probe(struct platform_device *pdev)
const struct catpt_spec *spec;
struct catpt_dev *cdev;
struct device *dev = &pdev->dev;
+ const struct acpi_device_id *id;
struct resource *res;
int ret;
+ 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, "CATPT ACPI driver not selected, aborting probe\n");
+ return -ENODEV;
+ }
+
spec = device_get_match_data(dev);
if (!spec)
return -ENODEV;