#include <sound/core.h>
#include <sound/intel-dsp-config.h>
#include <sound/intel-nhlt.h>
+#include <sound/soc-acpi.h>
static int dsp_driver;
u16 device;
u8 acpi_hid[ACPI_ID_LEN];
const struct dmi_system_id *dmi_table;
- u8 codec_hid[ACPI_ID_LEN];
+ const struct snd_soc_acpi_codecs *codec_hid;
+};
+
+static const struct snd_soc_acpi_codecs __maybe_unused essx_83x6 = {
+ .num_codecs = 3,
+ .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
};
/*
{
.flags = FLAG_SOF,
.device = 0x5a98,
- .codec_hid = "ESSX8336",
+ .codec_hid = &essx_83x6,
},
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL)
{
.flags = FLAG_SOF,
.device = 0x3198,
- .codec_hid = "ESSX8336",
+ .codec_hid = &essx_83x6,
},
#endif
{
.flags = FLAG_SOF,
.device = 0x02c8,
- .codec_hid = "ESSX8336",
+ .codec_hid = &essx_83x6,
},
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
{
.flags = FLAG_SOF,
.device = 0x06c8,
- .codec_hid = "ESSX8336",
+ .codec_hid = &essx_83x6,
},
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
{
.flags = FLAG_SOF,
.device = 0x4dc8,
- .codec_hid = "ESSX8336",
+ .codec_hid = &essx_83x6,
},
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC,
{
.flags = FLAG_SOF,
.device = 0xa0c8,
- .codec_hid = "ESSX8336",
+ .codec_hid = &essx_83x6,
},
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
continue;
if (table->dmi_table && !dmi_check_system(table->dmi_table))
continue;
- if (table->codec_hid[0] && !acpi_dev_present(table->codec_hid, NULL, -1))
- continue;
+ if (table->codec_hid) {
+ int i;
+
+ for (i = 0; i < table->codec_hid->num_codecs; i++)
+ if (acpi_dev_present(table->codec_hid->codecs[i], NULL, -1))
+ break;
+ if (i == table->codec_hid->num_codecs)
+ continue;
+ }
return table;
}
return NULL;