Commit 194fe0fc authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

ASoC: SOF: pci: move DSP_CONFIG use to platform-specific drivers

There is no reason why we should call the intel_dspcfg helpers from
common code, this should be moved in Intel-specific code and only
called from platforms where a conflict may occur with the HDaudio or
SST/Skylake driver.
Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: default avatarBard Liao <bard.liao@intel.com>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210302003125.1178419-5-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8d4ba1be
...@@ -22,10 +22,12 @@ ...@@ -22,10 +22,12 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/soundwire/sdw.h> #include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_intel.h> #include <linux/soundwire/sdw_intel.h>
#include <sound/intel-dsp-config.h>
#include <sound/intel-nhlt.h> #include <sound/intel-nhlt.h>
#include <sound/sof.h> #include <sound/sof.h>
#include <sound/sof/xtensa.h> #include <sound/sof/xtensa.h>
#include "../sof-audio.h" #include "../sof-audio.h"
#include "../sof-pci-dev.h"
#include "../ops.h" #include "../ops.h"
#include "hda.h" #include "hda.h"
...@@ -1258,7 +1260,22 @@ void hda_machine_select(struct snd_sof_dev *sdev) ...@@ -1258,7 +1260,22 @@ void hda_machine_select(struct snd_sof_dev *sdev)
dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n");
} }
int hda_pci_intel_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
{
int ret;
ret = snd_intel_dsp_driver_probe(pci);
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
return -ENODEV;
}
return sof_pci_probe(pci, pci_id);
}
EXPORT_SYMBOL_NS(hda_pci_intel_probe, SND_SOC_SOF_INTEL_HDA_COMMON);
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
MODULE_IMPORT_NS(SND_SOC_SOF_HDA_AUDIO_CODEC); MODULE_IMPORT_NS(SND_SOC_SOF_HDA_AUDIO_CODEC);
MODULE_IMPORT_NS(SND_SOC_SOF_HDA_AUDIO_CODEC_I915); MODULE_IMPORT_NS(SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
MODULE_IMPORT_NS(SND_SOC_SOF_XTENSA); MODULE_IMPORT_NS(SND_SOC_SOF_XTENSA);
......
...@@ -764,4 +764,7 @@ void hda_machine_select(struct snd_sof_dev *sdev); ...@@ -764,4 +764,7 @@ void hda_machine_select(struct snd_sof_dev *sdev);
void hda_set_mach_params(const struct snd_soc_acpi_mach *mach, void hda_set_mach_params(const struct snd_soc_acpi_mach *mach,
struct device *dev); struct device *dev);
/* PCI driver selection and probe */
int hda_pci_intel_probe(struct pci_dev *pci, const struct pci_device_id *pci_id);
#endif #endif
...@@ -67,7 +67,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids); ...@@ -67,7 +67,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);
static struct pci_driver snd_sof_pci_intel_apl_driver = { static struct pci_driver snd_sof_pci_intel_apl_driver = {
.name = "sof-audio-pci-intel-apl", .name = "sof-audio-pci-intel-apl",
.id_table = sof_pci_ids, .id_table = sof_pci_ids,
.probe = sof_pci_probe, .probe = hda_pci_intel_probe,
.remove = sof_pci_remove, .remove = sof_pci_remove,
.shutdown = sof_pci_shutdown, .shutdown = sof_pci_shutdown,
.driver = { .driver = {
......
...@@ -90,7 +90,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids); ...@@ -90,7 +90,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);
static struct pci_driver snd_sof_pci_intel_cnl_driver = { static struct pci_driver snd_sof_pci_intel_cnl_driver = {
.name = "sof-audio-pci-intel-cnl", .name = "sof-audio-pci-intel-cnl",
.id_table = sof_pci_ids, .id_table = sof_pci_ids,
.probe = sof_pci_probe, .probe = hda_pci_intel_probe,
.remove = sof_pci_remove, .remove = sof_pci_remove,
.shutdown = sof_pci_shutdown, .shutdown = sof_pci_shutdown,
.driver = { .driver = {
......
...@@ -70,7 +70,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids); ...@@ -70,7 +70,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);
static struct pci_driver snd_sof_pci_intel_icl_driver = { static struct pci_driver snd_sof_pci_intel_icl_driver = {
.name = "sof-audio-pci-intel-icl", .name = "sof-audio-pci-intel-icl",
.id_table = sof_pci_ids, .id_table = sof_pci_ids,
.probe = sof_pci_probe, .probe = hda_pci_intel_probe,
.remove = sof_pci_remove, .remove = sof_pci_remove,
.shutdown = sof_pci_shutdown, .shutdown = sof_pci_shutdown,
.driver = { .driver = {
......
...@@ -106,7 +106,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids); ...@@ -106,7 +106,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);
static struct pci_driver snd_sof_pci_intel_tgl_driver = { static struct pci_driver snd_sof_pci_intel_tgl_driver = {
.name = "sof-audio-pci-intel-tgl", .name = "sof-audio-pci-intel-tgl",
.id_table = sof_pci_ids, .id_table = sof_pci_ids,
.probe = sof_pci_probe, .probe = hda_pci_intel_probe,
.remove = sof_pci_remove, .remove = sof_pci_remove,
.shutdown = sof_pci_shutdown, .shutdown = sof_pci_shutdown,
.driver = { .driver = {
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <sound/intel-dsp-config.h>
#include <sound/soc-acpi.h> #include <sound/soc-acpi.h>
#include <sound/soc-acpi-intel-match.h> #include <sound/soc-acpi-intel-match.h>
#include <sound/sof.h> #include <sound/sof.h>
...@@ -120,13 +119,6 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) ...@@ -120,13 +119,6 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
const struct snd_sof_dsp_ops *ops; const struct snd_sof_dsp_ops *ops;
int ret; int ret;
if (IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)) {
ret = snd_intel_dsp_driver_probe(pci);
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
return -ENODEV;
}
}
dev_dbg(&pci->dev, "PCI DSP detected"); dev_dbg(&pci->dev, "PCI DSP detected");
/* get ops for platform */ /* get ops for platform */
......
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