Commit ec8a15d3 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

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: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-13-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8643e85a
......@@ -24,6 +24,7 @@ config SND_SOC_INTEL_CATPT
depends on DMADEVICES && SND_DMA_SGBUF
select DW_DMAC_CORE
select SND_SOC_ACPI_INTEL_MATCH
select SND_INTEL_DSP_CONFIG
help
Enable support for Intel(R) Haswell and Broadwell platforms
with I2S codec present. This is a recommended option.
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment