]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: Intel: soc-acpi: mirror CML and TGL configurations
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 21 Aug 2020 19:55:51 +0000 (14:55 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 24 Aug 2020 12:41:27 +0000 (13:41 +0100)
Some TGL devices use the same audio hardware as on CML platforms, with
RT711 on link0, RT1308 on link1 and optionally link2, and RT715 on
link 3.

To clarify configurations, the rt1308 configurations are split between
single amp on link1 and dual amps on link1. The case with two amps on
different links is already identified with the group1 attribute.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/common/soc-acpi-intel-cml-match.c
sound/soc/intel/common/soc-acpi-intel-tgl-match.c

index 51535cd60a0a18aaf55629dc8bd02bdce752178e..8ac01a2d5886d4e56f918e058a23cfedffe30a53 100644 (file)
@@ -118,7 +118,7 @@ static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
        }
 };
 
-static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
+static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
        {
                .adr = 0x000120025D130800,
                .num_endpoints = 1,
@@ -182,8 +182,8 @@ static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
        },
        {
                .mask = BIT(1),
-               .num_adr = ARRAY_SIZE(rt1308_1_adr),
-               .adr_d = rt1308_1_adr,
+               .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
+               .adr_d = rt1308_1_single_adr,
        },
        {
                .mask = BIT(3),
index 472f58ddda1f8ca041880fe5ab90b687c03561b5..aabb49617d379cfde61b5a089876b8b062d2e879 100644 (file)
@@ -43,7 +43,7 @@ static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
        }
 };
 
-static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
+static const struct snd_soc_acpi_adr_device rt1308_1_dual_adr[] = {
        {
                .adr = 0x000120025D130800,
                .num_endpoints = 1,
@@ -56,6 +56,38 @@ static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
        }
 };
 
+static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
+       {
+               .adr = 0x000120025D130800,
+               .num_endpoints = 1,
+               .endpoints = &single_endpoint,
+       }
+};
+
+static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
+       {
+               .adr = 0x000120025D130800,
+               .num_endpoints = 1,
+               .endpoints = &spk_l_endpoint,
+       }
+};
+
+static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
+       {
+               .adr = 0x000220025D130800,
+               .num_endpoints = 1,
+               .endpoints = &spk_r_endpoint,
+       }
+};
+
+static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
+       {
+               .adr = 0x000320025D071500,
+               .num_endpoints = 1,
+               .endpoints = &single_endpoint,
+       }
+};
+
 static const struct snd_soc_acpi_adr_device mx8373_1_adr[] = {
        {
                .adr = 0x000123019F837300,
@@ -94,8 +126,8 @@ static const struct snd_soc_acpi_link_adr tgl_rvp[] = {
        },
        {
                .mask = BIT(1),
-               .num_adr = ARRAY_SIZE(rt1308_1_adr),
-               .adr_d = rt1308_1_adr,
+               .num_adr = ARRAY_SIZE(rt1308_1_dual_adr),
+               .adr_d = rt1308_1_dual_adr,
        },
        {}
 };
@@ -114,6 +146,49 @@ static const struct snd_soc_acpi_link_adr tgl_chromebook_base[] = {
        {}
 };
 
+static const struct snd_soc_acpi_link_adr tgl_3_in_1_default[] = {
+       {
+               .mask = BIT(0),
+               .num_adr = ARRAY_SIZE(rt711_0_adr),
+               .adr_d = rt711_0_adr,
+       },
+       {
+               .mask = BIT(1),
+               .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
+               .adr_d = rt1308_1_group1_adr,
+       },
+       {
+               .mask = BIT(2),
+               .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
+               .adr_d = rt1308_2_group1_adr,
+       },
+       {
+               .mask = BIT(3),
+               .num_adr = ARRAY_SIZE(rt715_3_adr),
+               .adr_d = rt715_3_adr,
+       },
+       {}
+};
+
+static const struct snd_soc_acpi_link_adr tgl_3_in_1_mono_amp[] = {
+       {
+               .mask = BIT(0),
+               .num_adr = ARRAY_SIZE(rt711_0_adr),
+               .adr_d = rt711_0_adr,
+       },
+       {
+               .mask = BIT(1),
+               .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
+               .adr_d = rt1308_1_single_adr,
+       },
+       {
+               .mask = BIT(3),
+               .num_adr = ARRAY_SIZE(rt715_3_adr),
+               .adr_d = rt715_3_adr,
+       },
+       {}
+};
+
 static struct snd_soc_acpi_codecs tgl_max98373_amp = {
        .num_codecs = 1,
        .codecs = {"MX98373"}
@@ -150,6 +225,25 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_machines);
 
 /* this table is used when there is no I2S codec present */
 struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
+       {
+               .link_mask = 0xF, /* 4 active links required */
+               .links = tgl_3_in_1_default,
+               .drv_name = "sof_sdw",
+               .sof_fw_filename = "sof-tgl.ri",
+               .sof_tplg_filename = "sof-tgl-rt711-rt1308-rt715.tplg",
+       },
+       {
+               /*
+                * link_mask should be 0xB, but all links are enabled by BIOS.
+                * This entry will be selected if there is no rt1308 exposed
+                * on link2 since it will fail to match the above entry.
+                */
+               .link_mask = 0xF,
+               .links = tgl_3_in_1_mono_amp,
+               .drv_name = "sof_sdw",
+               .sof_fw_filename = "sof-tgl.ri",
+               .sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
+       },
        {
                .link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
                .links = tgl_rvp,