Instead of hardcording the SST driver having the highest prio, add FLAG_BYT_FIRST and FLAG_BYT_SECOND defines, which get set like this when both drivers are enabled: #define FLAG_BYT_FIRST FLAG_SST #define FLAG_BYT_SECOND FLAG_SOF And when only 1 driver is enabled then FLAG_BYT_FIRST gets set to the flag for that driver. This is a preparation patch for making which driver is preferred configurable through Kconfig. Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> --- sound/hda/intel-dsp-config.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c index c45686172517..2201a1e6944e 100644 --- a/sound/hda/intel-dsp-config.c +++ b/sound/hda/intel-dsp-config.c @@ -452,6 +452,16 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci) } EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe); +/* FLAG_BYT_FIRST / _SECOND determine which driver is preferred on BYT/CHT when both are enabled */ +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#define FLAG_BYT_FIRST FLAG_SST +#define FLAG_BYT_SECOND FLAG_SOF +#elif IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) +#define FLAG_BYT_FIRST FLAG_SST +#elif IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#define FLAG_BYT_FIRST FLAG_SOF +#endif + /* * configuration table * - the order of similar ACPI ID entries is important! @@ -459,28 +469,28 @@ EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe); */ static const struct config_entry acpi_config_table[] = { /* BayTrail */ -#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SST, + .flags = FLAG_BYT_FIRST, .acpi_hid = "80860F28", }, #endif -#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SOF, + .flags = FLAG_BYT_SECOND, .acpi_hid = "80860F28", }, #endif /* CherryTrail */ -#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SST, + .flags = FLAG_BYT_FIRST, .acpi_hid = "808622A8", }, #endif -#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SOF, + .flags = FLAG_BYT_SECOND, .acpi_hid = "808622A8", }, #endif -- 2.30.0