From 6b1633c860c297fbb0f163d739553150120e2c79 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Mon, 4 May 2026 11:13:54 +0800 Subject: [PATCH] ASoC: soc-acpi-intel-ptl-match: add ptl_cs42l43_agg_l3_cs35l56_l12_ghost_rt722 Some BIOS include a ghost ALC722 codec ADR while the hardware is not physically present. That's why we need to create an acpi mach table with empty endpoint. The ghost ALC722 codec with empty endpoint will be skipped by the machine driver. Signed-off-by: Bard Liao Closes:https://github.com/thesofproject/linux/issues/5721 --- .../intel/common/soc-acpi-intel-ptl-match.c | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-ptl-match.c b/sound/soc/intel/common/soc-acpi-intel-ptl-match.c index 3b7818355ff645..d28cfd3f3256ad 100644 --- a/sound/soc/intel/common/soc-acpi-intel-ptl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-ptl-match.c @@ -211,6 +211,25 @@ static const struct snd_soc_acpi_adr_device cs42l43_2_adr[] = { } }; +static const struct snd_soc_acpi_adr_device cs42l43_3_agg_rt722_ghost_adr[] = { + { + .adr = 0x00033001FA424301ull, + .num_endpoints = ARRAY_SIZE(cs42l43_amp_spkagg_endpoints), + .endpoints = cs42l43_amp_spkagg_endpoints, + .name_prefix = "cs42l43" + }, + /* + * To handle cases where the rt722 codec is listed in the BIOS while the + * hardware is not physically present. + */ + { + .adr = 0x000330025d072201ull, /* Ghost rt722 */ + .num_endpoints = 0, + .endpoints = NULL, + .name_prefix = "ghost" + } +}; + static const struct snd_soc_acpi_adr_device cs42l43_3_agg_adr[] = { { .adr = 0x00033001FA424301ull, @@ -235,6 +254,36 @@ static const struct snd_soc_acpi_adr_device cs35l56_2_lr_adr[] = { } }; +static const struct snd_soc_acpi_adr_device cs35l56_2_2amp_adr[] = { + { + .adr = 0x00023001fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_1_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00023101fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_2_endpoint, + .name_prefix = "AMP2" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_1_2amp_adr[] = { + { + .adr = 0x00013201fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_3_endpoint, + .name_prefix = "AMP3" + }, + { + .adr = 0x00013301fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_4_endpoint, + .name_prefix = "AMP4" + } +}; + static const struct snd_soc_acpi_adr_device cs35l56_1_3amp_adr[] = { { .adr = 0x00013001fa355601ull, @@ -394,6 +443,25 @@ static const struct snd_soc_acpi_adr_device rt1320_3_group2_adr[] = { } }; +static const struct snd_soc_acpi_link_adr ptl_cs42l43_agg_l3_cs35l56_l12_ghost_rt722[] = { + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs42l43_3_agg_rt722_ghost_adr), + .adr_d = cs42l43_3_agg_rt722_ghost_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_2amp_adr), + .adr_d = cs35l56_2_2amp_adr, + }, + { + .mask = BIT(1), + .num_adr = ARRAY_SIZE(cs35l56_1_2amp_adr), + .adr_d = cs35l56_1_2amp_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr ptl_cs42l43_agg_l3_cs35l56_l2[] = { { .mask = BIT(3), @@ -584,6 +652,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-ptl-cs42l43-l2-cs35l56x6-l13.tplg", }, + { + .link_mask = BIT(1) | BIT(2) | BIT(3), + .links = ptl_cs42l43_agg_l3_cs35l56_l12_ghost_rt722, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-ptl-dummy.tplg", + .get_function_tplg_files = sof_sdw_get_tplg_files, + }, { .link_mask = BIT(0) | BIT(2) | BIT(3), .links = ptl_rt722_l0_rt1320_l23,