ASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb + rt1320 support
authorBard Liao <yung-chuan.liao@linux.intel.com>
Fri, 6 Dec 2024 07:58:59 +0000 (15:58 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 9 Dec 2024 13:12:05 +0000 (13:12 +0000)
Add rt712_vb on SDW link 2 and 1 rt1320 on SDW link 1 configuration
support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/common/soc-acpi-intel-ptl-match.c

index f1c0d7a02cda38939d0156bcf4d0e63ee20d1a09..573fae541db73eab77b37110fd5efeca310b0a9d 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <sound/soc-acpi.h>
 #include <sound/soc-acpi-intel-match.h>
+#include "soc-acpi-intel-sdca-quirks.h"
 #include "soc-acpi-intel-sdw-mockup-match.h"
 #include <sound/soc-acpi-intel-ssp-common.h>
 
@@ -35,6 +36,13 @@ static const struct snd_soc_acpi_endpoint single_endpoint = {
        .group_id = 0,
 };
 
+static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
+       .num = 0,
+       .aggregated = 1,
+       .group_position = 1,
+       .group_id = 1,
+};
+
 /*
  * Multi-function codecs with three endpoints created for
  * headset, amp and dmic functions.
@@ -60,6 +68,30 @@ static const struct snd_soc_acpi_endpoint rt_mf_endpoints[] = {
        },
 };
 
+static const struct snd_soc_acpi_endpoint jack_amp_g1_dmic_endpoints_endpoints[] = {
+       /* Jack Endpoint */
+       {
+               .num = 0,
+               .aggregated = 0,
+               .group_position = 0,
+               .group_id = 0,
+       },
+       /* Amp Endpoint, work as spk_l_endpoint */
+       {
+               .num = 1,
+               .aggregated = 1,
+               .group_position = 0,
+               .group_id = 1,
+       },
+       /* DMIC Endpoint */
+       {
+               .num = 2,
+               .aggregated = 0,
+               .group_position = 0,
+               .group_id = 0,
+       },
+};
+
 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
        {
                .adr = 0x000030025D071101ull,
@@ -69,6 +101,15 @@ static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
        }
 };
 
+static const struct snd_soc_acpi_adr_device rt712_vb_2_group1_adr[] = {
+       {
+               .adr = 0x000230025D071201ull,
+               .num_endpoints = ARRAY_SIZE(jack_amp_g1_dmic_endpoints_endpoints),
+               .endpoints = jack_amp_g1_dmic_endpoints_endpoints,
+               .name_prefix = "rt712"
+       }
+};
+
 static const struct snd_soc_acpi_adr_device rt721_3_single_adr[] = {
        {
                .adr = 0x000330025d072101ull,
@@ -114,6 +155,15 @@ static const struct snd_soc_acpi_adr_device rt722_3_single_adr[] = {
        }
 };
 
+static const struct snd_soc_acpi_adr_device rt1320_1_group1_adr[] = {
+       {
+               .adr = 0x000130025D132001ull,
+               .num_endpoints = 1,
+               .endpoints = &spk_r_endpoint,
+               .name_prefix = "rt1320-1"
+       }
+};
+
 static const struct snd_soc_acpi_link_adr ptl_rt722_only[] = {
        {
                .mask = BIT(0),
@@ -150,6 +200,20 @@ static const struct snd_soc_acpi_link_adr ptl_rvp[] = {
        {}
 };
 
+static const struct snd_soc_acpi_link_adr lnl_sdw_rt712_vb_l2_rt1320_l1[] = {
+       {
+               .mask = BIT(2),
+               .num_adr = ARRAY_SIZE(rt712_vb_2_group1_adr),
+               .adr_d = rt712_vb_2_group1_adr,
+       },
+       {
+               .mask = BIT(1),
+               .num_adr = ARRAY_SIZE(rt1320_1_group1_adr),
+               .adr_d = rt1320_1_group1_adr,
+       },
+       {}
+};
+
 /* this table is used when there is no I2S codec present */
 struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
        /* mockup tests need to be first */
@@ -201,6 +265,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
                .drv_name = "sof_sdw",
                .sof_tplg_filename = "sof-ptl-rt722.tplg",
        },
+       {
+               .link_mask = BIT(1) | BIT(2),
+               .links = lnl_sdw_rt712_vb_l2_rt1320_l1,
+               .drv_name = "sof_sdw",
+               .machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
+               .sof_tplg_filename = "sof-lnl-rt712-l2-rt1320-l1.tplg"
+       },
        {},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_ptl_sdw_machines);