ALSA: hda: add Intel DSP configuration / probe code
[linux-2.6-block.git] / sound / soc / intel / skylake / skl.c
index 141dbbf975acdfea4b5c8b2a2e5e1efcc613ed9f..58ba3e9469ba04d6aaa6b1733a22bc8388768ce8 100644 (file)
@@ -27,6 +27,7 @@
 #include <sound/hda_i915.h>
 #include <sound/hda_codec.h>
 #include <sound/intel-nhlt.h>
+#include <sound/intel-dsp-config.h>
 #include "skl.h"
 #include "skl-sst-dsp.h"
 #include "skl-sst-ipc.h"
@@ -987,22 +988,10 @@ static int skl_probe(struct pci_dev *pci,
 
        switch (skl_pci_binding) {
        case SND_SKL_PCI_BIND_AUTO:
-               /*
-                * detect DSP by checking class/subclass/prog-id information
-                * class=04 subclass 03 prog-if 00: no DSP, use legacy driver
-                * class=04 subclass 01 prog-if 00: DSP is present
-                *   (and may be required e.g. for DMIC or SSP support)
-                * class=04 subclass 03 prog-if 80: use DSP or legacy mode
-                */
-               if (pci->class == 0x040300) {
-                       dev_info(&pci->dev, "The DSP is not enabled on this platform, aborting probe\n");
+               err = snd_intel_dsp_driver_probe(pci);
+               if (err != SND_INTEL_DSP_DRIVER_ANY &&
+                   err != SND_INTEL_DSP_DRIVER_SST)
                        return -ENODEV;
-               }
-               if (pci->class != 0x040100 && pci->class != 0x040380) {
-                       dev_err(&pci->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, aborting probe\n", pci->class);
-                       return -ENODEV;
-               }
-               dev_info(&pci->dev, "DSP detected with PCI class/subclass/prog-if info 0x%06x\n", pci->class);
                break;
        case SND_SKL_PCI_BIND_LEGACY:
                dev_info(&pci->dev, "Module parameter forced binding with HDaudio legacy, aborting probe\n");