1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2019 Jaroslav Kysela <perex@perex.cz>
4 #include <linux/acpi.h>
5 #include <linux/bits.h>
7 #include <linux/module.h>
9 #include <linux/soundwire/sdw.h>
10 #include <linux/soundwire/sdw_intel.h>
11 #include <sound/core.h>
12 #include <sound/intel-dsp-config.h>
13 #include <sound/intel-nhlt.h>
14 #include <sound/soc-acpi.h>
16 #include <acpi/nhlt.h>
18 static int dsp_driver
;
20 module_param(dsp_driver
, int, 0444);
21 MODULE_PARM_DESC(dsp_driver
, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF, 4=AVS)");
23 #define FLAG_SST BIT(0)
24 #define FLAG_SOF BIT(1)
25 #define FLAG_SST_ONLY_IF_DMIC BIT(15)
26 #define FLAG_SOF_ONLY_IF_DMIC BIT(16)
27 #define FLAG_SOF_ONLY_IF_SOUNDWIRE BIT(17)
29 #define FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE (FLAG_SOF_ONLY_IF_DMIC | \
30 FLAG_SOF_ONLY_IF_SOUNDWIRE)
35 u8 acpi_hid
[ACPI_ID_LEN
];
36 const struct dmi_system_id
*dmi_table
;
37 const struct snd_soc_acpi_codecs
*codec_hid
;
40 static const struct snd_soc_acpi_codecs __maybe_unused essx_83x6
= {
42 .codecs
= { "ESSX8316", "ESSX8326", "ESSX8336"},
47 * - the order of similar PCI ID entries is important!
48 * - the first successful match will win
50 static const struct config_entry config_table
[] = {
52 #if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD)
55 .device
= PCI_DEVICE_ID_INTEL_SST_TNG
,
59 * Skylake, Kabylake, Apollolake
60 * the legacy HDAudio driver is used except on Up Squared (SOF) and
61 * Chromebooks (SST), as well as devices based on the ES8336 codec
63 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_AVS)
66 .device
= PCI_DEVICE_ID_INTEL_HDA_SKL_LP
,
67 .dmi_table
= (const struct dmi_system_id
[]) {
69 .ident
= "Google Chromebooks",
71 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
78 .flags
= FLAG_SST
| FLAG_SST_ONLY_IF_DMIC
,
79 .device
= PCI_DEVICE_ID_INTEL_HDA_SKL_LP
,
83 .device
= PCI_DEVICE_ID_INTEL_HDA_KBL_LP
,
84 .dmi_table
= (const struct dmi_system_id
[]) {
86 .ident
= "Google Chromebooks",
88 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
95 .flags
= FLAG_SST
| FLAG_SST_ONLY_IF_DMIC
,
96 .device
= PCI_DEVICE_ID_INTEL_HDA_KBL_LP
,
100 .device
= PCI_DEVICE_ID_INTEL_HDA_APL
,
101 .dmi_table
= (const struct dmi_system_id
[]) {
103 .ident
= "Google Chromebooks",
105 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
112 #if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
115 .device
= PCI_DEVICE_ID_INTEL_HDA_APL
,
116 .dmi_table
= (const struct dmi_system_id
[]) {
118 .ident
= "Up Squared",
120 DMI_MATCH(DMI_SYS_VENDOR
, "AAEON"),
121 DMI_MATCH(DMI_BOARD_NAME
, "UP-APL01"),
129 .device
= PCI_DEVICE_ID_INTEL_HDA_APL
,
130 .codec_hid
= &essx_83x6
,
135 * Geminilake uses legacy HDAudio driver except for Google
136 * Chromebooks and devices based on the ES8336 codec
139 #if IS_ENABLED(CONFIG_SND_SOC_SOF_GEMINILAKE)
142 .device
= PCI_DEVICE_ID_INTEL_HDA_GML
,
143 .dmi_table
= (const struct dmi_system_id
[]) {
145 .ident
= "Google Chromebooks",
147 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
155 .device
= PCI_DEVICE_ID_INTEL_HDA_GML
,
156 .codec_hid
= &essx_83x6
,
161 * CoffeeLake, CannonLake, CometLake, IceLake, TigerLake, AlderLake,
162 * RaptorLake use legacy HDAudio driver except for Google Chromebooks
163 * and when DMICs are present. Two cases are required since Coreboot
164 * does not expose NHLT tables.
166 * When the Chromebook quirk is not present, it's based on information
167 * that no such device exists. When the quirk is present, it could be
168 * either based on product information or a placeholder.
172 #if IS_ENABLED(CONFIG_SND_SOC_SOF_CANNONLAKE)
175 .device
= PCI_DEVICE_ID_INTEL_HDA_CNL_LP
,
176 .dmi_table
= (const struct dmi_system_id
[]) {
178 .ident
= "Google Chromebooks",
180 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
186 DMI_MATCH(DMI_SYS_VENDOR
, "AAEON"),
194 .device
= PCI_DEVICE_ID_INTEL_HDA_CNL_LP
,
195 .codec_hid
= &essx_83x6
,
198 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
199 .device
= PCI_DEVICE_ID_INTEL_HDA_CNL_LP
,
204 #if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE)
207 .device
= PCI_DEVICE_ID_INTEL_HDA_CNL_H
,
208 .dmi_table
= (const struct dmi_system_id
[]) {
210 .ident
= "Google Chromebooks",
212 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
219 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
220 .device
= PCI_DEVICE_ID_INTEL_HDA_CNL_H
,
224 #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE)
228 .device
= PCI_DEVICE_ID_INTEL_HDA_CML_LP
,
229 .dmi_table
= (const struct dmi_system_id
[]) {
231 .ident
= "Google Chromebooks",
233 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
238 DMI_MATCH(DMI_SYS_VENDOR
, "Dell Inc"),
239 DMI_EXACT_MATCH(DMI_PRODUCT_SKU
, "09C6")
243 /* early version of SKU 09C6 */
245 DMI_MATCH(DMI_SYS_VENDOR
, "Dell Inc"),
246 DMI_EXACT_MATCH(DMI_PRODUCT_SKU
, "0983")
254 .device
= PCI_DEVICE_ID_INTEL_HDA_CML_LP
,
255 .codec_hid
= &essx_83x6
,
258 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
259 .device
= PCI_DEVICE_ID_INTEL_HDA_CML_LP
,
264 .device
= PCI_DEVICE_ID_INTEL_HDA_CML_H
,
265 .dmi_table
= (const struct dmi_system_id
[]) {
268 DMI_MATCH(DMI_SYS_VENDOR
, "Dell Inc"),
269 DMI_EXACT_MATCH(DMI_PRODUCT_SKU
, "098F"),
274 DMI_MATCH(DMI_SYS_VENDOR
, "Dell Inc"),
275 DMI_EXACT_MATCH(DMI_PRODUCT_SKU
, "0990"),
283 .device
= PCI_DEVICE_ID_INTEL_HDA_CML_H
,
284 .codec_hid
= &essx_83x6
,
287 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
288 .device
= PCI_DEVICE_ID_INTEL_HDA_CML_H
,
293 #if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE)
296 .device
= PCI_DEVICE_ID_INTEL_HDA_ICL_LP
,
297 .dmi_table
= (const struct dmi_system_id
[]) {
299 .ident
= "Google Chromebooks",
301 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
309 .device
= PCI_DEVICE_ID_INTEL_HDA_ICL_LP
,
310 .codec_hid
= &essx_83x6
,
313 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
314 .device
= PCI_DEVICE_ID_INTEL_HDA_ICL_LP
,
319 #if IS_ENABLED(CONFIG_SND_SOC_SOF_JASPERLAKE)
322 .device
= PCI_DEVICE_ID_INTEL_HDA_JSL_N
,
323 .dmi_table
= (const struct dmi_system_id
[]) {
325 .ident
= "Google Chromebooks",
327 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
331 .ident
= "Google firmware",
333 DMI_MATCH(DMI_BIOS_VERSION
, "Google"),
341 .device
= PCI_DEVICE_ID_INTEL_HDA_JSL_N
,
342 .codec_hid
= &essx_83x6
,
345 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC
,
346 .device
= PCI_DEVICE_ID_INTEL_HDA_JSL_N
,
351 #if IS_ENABLED(CONFIG_SND_SOC_SOF_TIGERLAKE)
354 .device
= PCI_DEVICE_ID_INTEL_HDA_TGL_LP
,
355 .dmi_table
= (const struct dmi_system_id
[]) {
357 .ident
= "Google Chromebooks",
359 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
365 DMI_MATCH(DMI_SYS_VENDOR
, "AAEON"),
373 .device
= PCI_DEVICE_ID_INTEL_HDA_TGL_LP
,
374 .codec_hid
= &essx_83x6
,
377 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
378 .device
= PCI_DEVICE_ID_INTEL_HDA_TGL_LP
,
381 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
382 .device
= PCI_DEVICE_ID_INTEL_HDA_TGL_H
,
387 #if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE)
389 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC
,
390 .device
= PCI_DEVICE_ID_INTEL_HDA_EHL_0
,
393 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC
,
394 .device
= PCI_DEVICE_ID_INTEL_HDA_EHL_3
,
398 /* Alder Lake / Raptor Lake */
399 #if IS_ENABLED(CONFIG_SND_SOC_SOF_ALDERLAKE)
401 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
402 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_S
,
405 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
406 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_S
,
410 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_P
,
411 .dmi_table
= (const struct dmi_system_id
[]) {
413 .ident
= "Google Chromebooks",
415 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
423 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_P
,
424 .codec_hid
= &essx_83x6
,
427 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
428 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_P
,
431 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
432 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_PX
,
436 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_PS
,
437 .codec_hid
= &essx_83x6
,
440 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
441 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_PS
,
444 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
445 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_M
,
449 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_N
,
450 .dmi_table
= (const struct dmi_system_id
[]) {
452 .ident
= "Google Chromebooks",
454 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
461 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
462 .device
= PCI_DEVICE_ID_INTEL_HDA_ADL_N
,
466 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_P_0
,
467 .dmi_table
= (const struct dmi_system_id
[]) {
469 .ident
= "Google Chromebooks",
471 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
478 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
479 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_P_0
,
483 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_P_1
,
484 .dmi_table
= (const struct dmi_system_id
[]) {
486 .ident
= "Google Chromebooks",
488 DMI_MATCH(DMI_SYS_VENDOR
, "Google"),
495 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
496 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_P_1
,
499 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
500 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_M
,
503 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
504 .device
= PCI_DEVICE_ID_INTEL_HDA_RPL_PX
,
509 #if IS_ENABLED(CONFIG_SND_SOC_SOF_METEORLAKE)
512 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
513 .device
= PCI_DEVICE_ID_INTEL_HDA_MTL
,
517 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
518 .device
= PCI_DEVICE_ID_INTEL_HDA_ARL_S
,
522 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
523 .device
= PCI_DEVICE_ID_INTEL_HDA_ARL
,
528 #if IS_ENABLED(CONFIG_SND_SOC_SOF_LUNARLAKE)
531 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
532 .device
= PCI_DEVICE_ID_INTEL_HDA_LNL_P
,
537 #if IS_ENABLED(CONFIG_SND_SOC_SOF_PANTHERLAKE)
539 .flags
= FLAG_SOF
| FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
,
540 .device
= PCI_DEVICE_ID_INTEL_HDA_PTL
,
546 static const struct config_entry
*snd_intel_dsp_find_config
547 (struct pci_dev
*pci
, const struct config_entry
*table
, u32 len
)
551 device
= pci
->device
;
552 for (; len
> 0; len
--, table
++) {
553 if (table
->device
!= device
)
555 if (table
->dmi_table
&& !dmi_check_system(table
->dmi_table
))
557 if (table
->codec_hid
) {
560 for (i
= 0; i
< table
->codec_hid
->num_codecs
; i
++) {
561 struct nhlt_acpi_table
*nhlt
;
562 bool ssp_found
= false;
564 if (!acpi_dev_present(table
->codec_hid
->codecs
[i
], NULL
, -1))
567 nhlt
= intel_nhlt_init(&pci
->dev
);
569 dev_warn(&pci
->dev
, "%s: NHLT table not found, skipped HID %s\n",
570 __func__
, table
->codec_hid
->codecs
[i
]);
574 if (intel_nhlt_has_endpoint_type(nhlt
, NHLT_LINK_SSP
) &&
575 intel_nhlt_ssp_endpoint_mask(nhlt
, NHLT_DEVICE_I2S
))
578 intel_nhlt_free(nhlt
);
583 dev_warn(&pci
->dev
, "%s: no valid SSP found for HID %s, skipped\n",
584 __func__
, table
->codec_hid
->codecs
[i
]);
586 if (i
== table
->codec_hid
->num_codecs
)
594 static int snd_intel_dsp_check_dmic(struct pci_dev
*pci
)
598 acpi_nhlt_get_gbl_table();
600 if (acpi_nhlt_find_endpoint(ACPI_NHLT_LINKTYPE_PDM
, -1, -1, -1))
603 acpi_nhlt_put_gbl_table();
608 #if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)
609 static int snd_intel_dsp_check_soundwire(struct pci_dev
*pci
)
611 struct sdw_intel_acpi_info info
;
615 handle
= ACPI_HANDLE(&pci
->dev
);
617 ret
= sdw_intel_acpi_scan(handle
, &info
);
621 return info
.link_mask
;
624 static int snd_intel_dsp_check_soundwire(struct pci_dev
*pci
)
630 int snd_intel_dsp_driver_probe(struct pci_dev
*pci
)
632 const struct config_entry
*cfg
;
634 /* Intel vendor only */
635 if (pci
->vendor
!= PCI_VENDOR_ID_INTEL
)
636 return SND_INTEL_DSP_DRIVER_ANY
;
639 * Legacy devices don't have a PCI-based DSP and use HDaudio
640 * for HDMI/DP support, ignore kernel parameter
642 switch (pci
->device
) {
643 case PCI_DEVICE_ID_INTEL_HDA_BDW
:
644 case PCI_DEVICE_ID_INTEL_HDA_HSW_0
:
645 case PCI_DEVICE_ID_INTEL_HDA_HSW_2
:
646 case PCI_DEVICE_ID_INTEL_HDA_HSW_3
:
647 case PCI_DEVICE_ID_INTEL_HDA_BYT
:
648 case PCI_DEVICE_ID_INTEL_HDA_BSW
:
649 return SND_INTEL_DSP_DRIVER_ANY
;
652 if (dsp_driver
> 0 && dsp_driver
<= SND_INTEL_DSP_DRIVER_LAST
)
656 * detect DSP by checking class/subclass/prog-id information
657 * class=04 subclass 03 prog-if 00: no DSP, use legacy driver
658 * class=04 subclass 01 prog-if 00: DSP is present
659 * (and may be required e.g. for DMIC or SSP support)
660 * class=04 subclass 03 prog-if 80: use DSP or legacy mode
662 if (pci
->class == 0x040300)
663 return SND_INTEL_DSP_DRIVER_LEGACY
;
664 if (pci
->class != 0x040100 && pci
->class != 0x040380) {
665 dev_err(&pci
->dev
, "Unknown PCI class/subclass/prog-if information (0x%06x) found, selecting HDAudio legacy driver\n", pci
->class);
666 return SND_INTEL_DSP_DRIVER_LEGACY
;
669 dev_dbg(&pci
->dev
, "DSP detected with PCI class/subclass/prog-if info 0x%06x\n", pci
->class);
671 /* find the configuration for the specific device */
672 cfg
= snd_intel_dsp_find_config(pci
, config_table
, ARRAY_SIZE(config_table
));
674 return SND_INTEL_DSP_DRIVER_ANY
;
676 if (cfg
->flags
& FLAG_SOF
) {
677 if (cfg
->flags
& FLAG_SOF_ONLY_IF_SOUNDWIRE
&&
678 snd_intel_dsp_check_soundwire(pci
) > 0) {
679 dev_info_once(&pci
->dev
, "SoundWire enabled on CannonLake+ platform, using SOF driver\n");
680 return SND_INTEL_DSP_DRIVER_SOF
;
682 if (cfg
->flags
& FLAG_SOF_ONLY_IF_DMIC
&&
683 snd_intel_dsp_check_dmic(pci
)) {
684 dev_info_once(&pci
->dev
, "Digital mics found on Skylake+ platform, using SOF driver\n");
685 return SND_INTEL_DSP_DRIVER_SOF
;
687 if (!(cfg
->flags
& FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE
))
688 return SND_INTEL_DSP_DRIVER_SOF
;
692 if (cfg
->flags
& FLAG_SST
) {
693 if (cfg
->flags
& FLAG_SST_ONLY_IF_DMIC
) {
694 if (snd_intel_dsp_check_dmic(pci
)) {
695 dev_info_once(&pci
->dev
, "Digital mics found on Skylake+ platform, using SST driver\n");
696 return SND_INTEL_DSP_DRIVER_SST
;
699 return SND_INTEL_DSP_DRIVER_SST
;
703 return SND_INTEL_DSP_DRIVER_LEGACY
;
705 EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe
);
707 /* Should we default to SOF or SST for BYT/CHT ? */
708 #if IS_ENABLED(CONFIG_SND_INTEL_BYT_PREFER_SOF) || \
709 !IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI)
710 #define FLAG_SST_OR_SOF_BYT FLAG_SOF
712 #define FLAG_SST_OR_SOF_BYT FLAG_SST
716 * configuration table
717 * - the order of similar ACPI ID entries is important!
718 * - the first successful match will win
720 static const struct config_entry acpi_config_table
[] = {
721 #if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || \
722 IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
725 .flags
= FLAG_SST_OR_SOF_BYT
,
726 .acpi_hid
= "LPE0F28",
729 .flags
= FLAG_SST_OR_SOF_BYT
,
730 .acpi_hid
= "80860F28",
734 .flags
= FLAG_SST_OR_SOF_BYT
,
735 .acpi_hid
= "808622A8",
739 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_CATPT)
742 .acpi_hid
= "INT3438"
745 #if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
748 .acpi_hid
= "INT3438"
751 /* Haswell - not supported by SOF but added for consistency */
752 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_CATPT)
755 .acpi_hid
= "INT33C8"
760 static const struct config_entry
*snd_intel_acpi_dsp_find_config(const u8 acpi_hid
[ACPI_ID_LEN
],
761 const struct config_entry
*table
,
764 for (; len
> 0; len
--, table
++) {
765 if (memcmp(table
->acpi_hid
, acpi_hid
, ACPI_ID_LEN
))
767 if (table
->dmi_table
&& !dmi_check_system(table
->dmi_table
))
774 int snd_intel_acpi_dsp_driver_probe(struct device
*dev
, const u8 acpi_hid
[ACPI_ID_LEN
])
776 const struct config_entry
*cfg
;
778 if (dsp_driver
> SND_INTEL_DSP_DRIVER_LEGACY
&& dsp_driver
<= SND_INTEL_DSP_DRIVER_LAST
)
781 if (dsp_driver
== SND_INTEL_DSP_DRIVER_LEGACY
) {
782 dev_warn(dev
, "dsp_driver parameter %d not supported, using automatic detection\n",
783 SND_INTEL_DSP_DRIVER_LEGACY
);
786 /* find the configuration for the specific device */
787 cfg
= snd_intel_acpi_dsp_find_config(acpi_hid
, acpi_config_table
,
788 ARRAY_SIZE(acpi_config_table
));
790 return SND_INTEL_DSP_DRIVER_ANY
;
792 if (cfg
->flags
& FLAG_SST
)
793 return SND_INTEL_DSP_DRIVER_SST
;
795 if (cfg
->flags
& FLAG_SOF
)
796 return SND_INTEL_DSP_DRIVER_SOF
;
798 return SND_INTEL_DSP_DRIVER_SST
;
800 EXPORT_SYMBOL_GPL(snd_intel_acpi_dsp_driver_probe
);
802 MODULE_LICENSE("GPL v2");
803 MODULE_DESCRIPTION("Intel DSP config driver");
804 MODULE_IMPORT_NS("SND_INTEL_SOUNDWIRE_ACPI");