Commit de24d97f authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ALSA: intel-dsp-config: add more ACPI HIDs for ES83x6 devices

We only saw ESSX8336 so far, but now with reports of 'ESSX8326' we
need to expand to a full list. Let's reuse the 'snd_soc_acpi_codecs'
structure to store the information.
Reported-by: default avataranthony tonitch <d.tonitch@gmail.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220308192610.392950-8-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4694b838
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <sound/core.h> #include <sound/core.h>
#include <sound/intel-dsp-config.h> #include <sound/intel-dsp-config.h>
#include <sound/intel-nhlt.h> #include <sound/intel-nhlt.h>
#include <sound/soc-acpi.h>
static int dsp_driver; static int dsp_driver;
...@@ -31,7 +32,12 @@ struct config_entry { ...@@ -31,7 +32,12 @@ struct config_entry {
u16 device; u16 device;
u8 acpi_hid[ACPI_ID_LEN]; u8 acpi_hid[ACPI_ID_LEN];
const struct dmi_system_id *dmi_table; 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"},
}; };
/* /*
...@@ -77,7 +83,7 @@ static const struct config_entry config_table[] = { ...@@ -77,7 +83,7 @@ static const struct config_entry config_table[] = {
{ {
.flags = FLAG_SOF, .flags = FLAG_SOF,
.device = 0x5a98, .device = 0x5a98,
.codec_hid = "ESSX8336", .codec_hid = &essx_83x6,
}, },
#endif #endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL) #if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL)
...@@ -163,7 +169,7 @@ static const struct config_entry config_table[] = { ...@@ -163,7 +169,7 @@ static const struct config_entry config_table[] = {
{ {
.flags = FLAG_SOF, .flags = FLAG_SOF,
.device = 0x3198, .device = 0x3198,
.codec_hid = "ESSX8336", .codec_hid = &essx_83x6,
}, },
#endif #endif
...@@ -251,7 +257,7 @@ static const struct config_entry config_table[] = { ...@@ -251,7 +257,7 @@ static const struct config_entry config_table[] = {
{ {
.flags = FLAG_SOF, .flags = FLAG_SOF,
.device = 0x02c8, .device = 0x02c8,
.codec_hid = "ESSX8336", .codec_hid = &essx_83x6,
}, },
{ {
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
...@@ -280,7 +286,7 @@ static const struct config_entry config_table[] = { ...@@ -280,7 +286,7 @@ static const struct config_entry config_table[] = {
{ {
.flags = FLAG_SOF, .flags = FLAG_SOF,
.device = 0x06c8, .device = 0x06c8,
.codec_hid = "ESSX8336", .codec_hid = &essx_83x6,
}, },
{ {
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
...@@ -327,7 +333,7 @@ static const struct config_entry config_table[] = { ...@@ -327,7 +333,7 @@ static const struct config_entry config_table[] = {
{ {
.flags = FLAG_SOF, .flags = FLAG_SOF,
.device = 0x4dc8, .device = 0x4dc8,
.codec_hid = "ESSX8336", .codec_hid = &essx_83x6,
}, },
{ {
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC,
...@@ -353,7 +359,7 @@ static const struct config_entry config_table[] = { ...@@ -353,7 +359,7 @@ static const struct config_entry config_table[] = {
{ {
.flags = FLAG_SOF, .flags = FLAG_SOF,
.device = 0xa0c8, .device = 0xa0c8,
.codec_hid = "ESSX8336", .codec_hid = &essx_83x6,
}, },
{ {
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
...@@ -414,8 +420,15 @@ static const struct config_entry *snd_intel_dsp_find_config ...@@ -414,8 +420,15 @@ static const struct config_entry *snd_intel_dsp_find_config
continue; continue;
if (table->dmi_table && !dmi_check_system(table->dmi_table)) if (table->dmi_table && !dmi_check_system(table->dmi_table))
continue; continue;
if (table->codec_hid[0] && !acpi_dev_present(table->codec_hid, NULL, -1)) if (table->codec_hid) {
continue; 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 table;
} }
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment