]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: amd: acp-config: Enable SOF audio for Google chrome boards.
authorAjit Kumar Pandey <AjitKumar.Pandey@amd.com>
Tue, 21 Dec 2021 16:18:08 +0000 (21:48 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 21 Dec 2021 16:40:24 +0000 (16:40 +0000)
We need to support sof audio on different variants of Google boards.
Add new entry in dmi table to enable SOF flag on Google chrome boards.
Also add newer machines to sof_machines list with codecs and amps acpi
id check to register sof sound cards on different variants.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Link: https://lore.kernel.org/r/20211221161814.236318-2-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp-config.c

index 1493d52c92907e66851def86f4deb1830acb6897..c0bbcdb1761d1d8f819838489d4515a2936e07e8 100644 (file)
@@ -35,6 +35,18 @@ static const struct config_entry config_table[] = {
                        {}
                },
        },
+       {
+               .flags = FLAG_AMD_SOF,
+               .device = ACP_PCI_DEV_ID,
+               .dmi_table = (const struct dmi_system_id []) {
+                       {
+                               .matches = {
+                                       DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+                               },
+                       },
+                       {}
+               },
+       },
 };
 
 int snd_amd_acp_find_config(struct pci_dev *pci)
@@ -43,6 +55,10 @@ int snd_amd_acp_find_config(struct pci_dev *pci)
        u16 device = pci->device;
        int i;
 
+       /* Do not enable FLAGS on older platforms with Rev id zero */
+       if (!pci->revision)
+               return 0;
+
        for (i = 0; i < ARRAY_SIZE(config_table); i++, table++) {
                if (table->device != device)
                        continue;
@@ -56,7 +72,44 @@ int snd_amd_acp_find_config(struct pci_dev *pci)
 }
 EXPORT_SYMBOL(snd_amd_acp_find_config);
 
+static struct snd_soc_acpi_codecs amp_rt1019 = {
+       .num_codecs = 1,
+       .codecs = {"10EC1019"}
+};
+
+static struct snd_soc_acpi_codecs amp_max = {
+       .num_codecs = 1,
+       .codecs = {"MX98360A"}
+};
+
 struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = {
+       {
+               .id = "10EC5682",
+               .drv_name = "rt5682-rt1019",
+               .pdata = (void *)&acp_quirk_data,
+               .machine_quirk = snd_soc_acpi_codec_list,
+               .quirk_data = &amp_rt1019,
+               .fw_filename = "sof-rn.ri",
+               .sof_tplg_filename = "sof-acp.tplg",
+       },
+       {
+               .id = "10EC5682",
+               .drv_name = "rt5682-max",
+               .pdata = (void *)&acp_quirk_data,
+               .machine_quirk = snd_soc_acpi_codec_list,
+               .quirk_data = &amp_max,
+               .fw_filename = "sof-rn.ri",
+               .sof_tplg_filename = "sof-acp.tplg",
+       },
+       {
+               .id = "RTL5682",
+               .drv_name = "rt5682s-max",
+               .pdata = (void *)&acp_quirk_data,
+               .machine_quirk = snd_soc_acpi_codec_list,
+               .quirk_data = &amp_max,
+               .fw_filename = "sof-rn.ri",
+               .sof_tplg_filename = "sof-acp.tplg",
+       },
        {
                .id = "AMDI1019",
                .drv_name = "renoir-dsp",