|
40 | 40 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
|
41 | 41 | #include "../../../soc/codecs/hdac_hda.h"
|
42 | 42 | #endif
|
| 43 | +static int skl_pci_binding; |
| 44 | +module_param_named(pci_binding, skl_pci_binding, int, 0444); |
| 45 | +MODULE_PARM_DESC(pci_binding, "PCI binding (0=auto, 1=only legacy, 2=only asoc"); |
43 | 46 |
|
44 | 47 | /*
|
45 | 48 | * initialize the PCI registers
|
@@ -896,21 +899,6 @@ static int skl_first_init(struct hdac_bus *bus)
|
896 | 899 | unsigned short gcap;
|
897 | 900 | int cp_streams, pb_streams, start_idx;
|
898 | 901 |
|
899 |
| - /* |
900 |
| - * detect DSP by checking class/subclass/prog-id information |
901 |
| - * class=04 subclass 03 prog-if 00: no DSP, legacy driver needs to be used |
902 |
| - * class=04 subclass 01 prog-if 00: DSP is present (and may be required e.g. for DMIC or SSP support) |
903 |
| - * class=04 subclass 03 prog-if 80: either of DSP or legacy mode can be used |
904 |
| - */ |
905 |
| - if (pci->class == 0x040300) { |
906 |
| - dev_err(bus->dev, "The DSP is not enabled on this platform, aborting probe\n"); |
907 |
| - return -ENODEV; |
908 |
| - } else if (pci->class != 0x040100 && pci->class != 0x040380) { |
909 |
| - dev_err(bus->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, aborting probe\n", pci->class); |
910 |
| - return -ENODEV; |
911 |
| - } |
912 |
| - dev_info(bus->dev, "DSP detected with PCI class/subclass/prog-if info 0x%06x\n", pci->class); |
913 |
| - |
914 | 902 | err = pci_request_regions(pci, "Skylake HD audio");
|
915 | 903 | if (err < 0)
|
916 | 904 | return err;
|
@@ -984,6 +972,36 @@ static int skl_probe(struct pci_dev *pci,
|
984 | 972 | struct hdac_bus *bus = NULL;
|
985 | 973 | int err;
|
986 | 974 |
|
| 975 | + switch (skl_pci_binding) { |
| 976 | + case SND_SKL_PCI_BIND_AUTO: |
| 977 | + /* |
| 978 | + * detect DSP by checking class/subclass/prog-id information |
| 979 | + * class=04 subclass 03 prog-if 00: no DSP, use legacy driver |
| 980 | + * class=04 subclass 01 prog-if 00: DSP is present |
| 981 | + * (and may be required e.g. for DMIC or SSP support) |
| 982 | + * class=04 subclass 03 prog-if 80: use DSP or legacy mode |
| 983 | + */ |
| 984 | + if (pci->class == 0x040300) { |
| 985 | + dev_info(&pci->dev, "The DSP is not enabled on this platform, aborting probe\n"); |
| 986 | + return -ENODEV; |
| 987 | + } |
| 988 | + if (pci->class != 0x040100 && pci->class != 0x040380) { |
| 989 | + dev_err(&pci->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, aborting probe\n", pci->class); |
| 990 | + return -ENODEV; |
| 991 | + } |
| 992 | + dev_info(&pci->dev, "DSP detected with PCI class/subclass/prog-if info 0x%06x\n", pci->class); |
| 993 | + break; |
| 994 | + case SND_SKL_PCI_BIND_LEGACY: |
| 995 | + dev_info(&pci->dev, "Module parameter forced binding with HDaudio legacy, aborting probe\n"); |
| 996 | + return -ENODEV; |
| 997 | + case SND_SKL_PCI_BIND_ASOC: |
| 998 | + dev_info(&pci->dev, "Module parameter forced binding with SKL driver, bypassed detection logic\n"); |
| 999 | + break; |
| 1000 | + default: |
| 1001 | + dev_err(&pci->dev, "invalid value for skl_pci_binding module parameter, ignored\n"); |
| 1002 | + break; |
| 1003 | + } |
| 1004 | + |
987 | 1005 | /* we use ext core ops, so provide NULL for ops here */
|
988 | 1006 | err = skl_create(pci, NULL, &skl);
|
989 | 1007 | if (err < 0)
|
|
0 commit comments