ASoC: Intel: sof_nau8825: mach cleanup for adl boards
authorBrent Lu <brent.lu@intel.com>
Wed, 27 Mar 2024 16:23:58 +0000 (11:23 -0500)
committerMark Brown <broonie@kernel.org>
Thu, 28 Mar 2024 13:58:16 +0000 (13:58 +0000)
Add a common entry in enumeration table for all nau8825 boards
with/without speaker amplifier. All other adl_nau8825_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/common/soc-acpi-intel-adl-match.c

index 7ce8aade07d70e9ce3bd87805ca942ff609f98f8..f8b8864b5ec65d5f8cd0d70d4be235b58d84301f 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <sound/soc-acpi.h>
 #include <sound/soc-acpi-intel-match.h>
+#include <sound/soc-acpi-intel-ssp-common.h>
 
 static const struct snd_soc_acpi_codecs essx_83x6 = {
        .num_codecs = 3,
@@ -467,11 +468,6 @@ static const struct snd_soc_acpi_codecs adl_rt5682_rt5682s_hp = {
        .codecs = {"10EC5682", "RTL5682"},
 };
 
-static const struct snd_soc_acpi_codecs adl_rt1015p_amp = {
-       .num_codecs = 1,
-       .codecs = {"RTL1015"}
-};
-
 static const struct snd_soc_acpi_codecs adl_rt1019p_amp = {
        .num_codecs = 1,
        .codecs = {"RTL1019"}
@@ -487,11 +483,6 @@ static const struct snd_soc_acpi_codecs adl_lt6911_hdmi = {
        .codecs = {"INTC10B0"}
 };
 
-static const struct snd_soc_acpi_codecs adl_nau8318_amp = {
-       .num_codecs = 1,
-       .codecs = {"NVTN2012"}
-};
-
 static struct snd_soc_acpi_codecs adl_rt5650_amp = {
        .num_codecs = 1,
        .codecs = {"10EC5650"}
@@ -526,20 +517,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
                .quirk_data = &adl_rt1019p_amp,
                .sof_tplg_filename = "sof-adl-rt1019-nau8825.tplg",
        },
-       {
-               .id = "10508825",
-               .drv_name = "adl_nau8825_def",
-               .machine_quirk = snd_soc_acpi_codec_list,
-               .quirk_data = &adl_max98373_amp,
-               .sof_tplg_filename = "sof-adl-max98373-nau8825.tplg",
-       },
-       {
-               .id = "10508825",
-               .drv_name = "adl_nau8825_def",
-               .machine_quirk = snd_soc_acpi_codec_list,
-               .quirk_data = &adl_max98360a_amp,
-               .sof_tplg_filename = "sof-adl-max98360a-nau8825.tplg",
-       },
        {
                .comp_ids = &adl_rt5682_rt5682s_hp,
                .drv_name = "adl_rt5682_def",
@@ -547,25 +524,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
                .quirk_data = &adl_rt1019p_amp,
                .sof_tplg_filename = "sof-adl-rt1019-rt5682.tplg",
        },
-       {
-               .id = "10508825",
-               .drv_name = "adl_nau8825_def",
-               .machine_quirk = snd_soc_acpi_codec_list,
-               .quirk_data = &adl_rt1015p_amp,
-               .sof_tplg_filename = "sof-adl-rt1015-nau8825.tplg",
-       },
-       {
-               .id = "10508825",
-               .drv_name = "adl_nau8825_def",
-               .machine_quirk = snd_soc_acpi_codec_list,
-               .quirk_data = &adl_nau8318_amp,
-               .sof_tplg_filename = "sof-adl-nau8318-nau8825.tplg",
-       },
-       {
-               .id = "10508825",
-               .drv_name = "adl_nau8825_def",
-               .sof_tplg_filename = "sof-adl-nau8825.tplg",
-       },
        {
                .comp_ids = &adl_rt5682_rt5682s_hp,
                .drv_name = "adl_rt5682_def",
@@ -621,6 +579,16 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
                .quirk_data = &adl_max98360a_amp,
                .sof_tplg_filename = "sof-adl-max98360a-da7219.tplg",
        },
+       /* place boards for each headphone codec: sof driver will complete the
+        * tplg name and machine driver will detect the amp type
+        */
+       {
+               .id = NAU8825_ACPI_HID,
+               .drv_name = "adl_nau8825_def",
+               .sof_tplg_filename = "sof-adl", /* the tplg suffix is added at run time */
+               .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
+                                       SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
+       },
        /* place amp-only boards in the end of table */
        {
                .id = "CSC3541",