From db06e7b35c1c9ffcc7486875139fa728f895f351 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Fri, 5 Jun 2026 18:18:04 +0800 Subject: [PATCH 1/2] ASoC: soc_sdw_utils: add is_amp flag to all amps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The is_amp flag will be used for the codec name_prefix. We detect it by checking if the codec support endpoints other than amp. However, it is not accurate. Currently, the is_amp flag is only set to the amps that include other types of endpoints. But it can't cover the case that a monolithic codec that only the amp endpoint is present. Add the is_amp flag to all amp type codecs and will set the name_prefix by the flag in the follow up commit. Signed-off-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Charles Keepax Link: https://patch.msgid.link/20260605101805.121428-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/sdw_utils/soc_sdw_utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index e440c2327100..9b062c0b5924 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -76,6 +76,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x0102, .part_id = 0x0000, /* TAS2783A */ .name_prefix = "tas2783", + .is_amp = true, .dais = { { .direction = {true, true}, @@ -266,6 +267,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .part_id = 0x1308, .name_prefix = "rt1308", .acpi_id = "10EC1308", + .is_amp = true, .dais = { { .direction = {true, false}, @@ -289,6 +291,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x025d, .part_id = 0x1316, .name_prefix = "rt1316", + .is_amp = true, .dais = { { .direction = {true, true}, @@ -311,6 +314,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x025d, .part_id = 0x1318, .name_prefix = "rt1318", + .is_amp = true, .dais = { { .direction = {true, true}, @@ -561,6 +565,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x019f, .part_id = 0x8373, .name_prefix = "Left", + .is_amp = true, .dais = { { .direction = {true, true}, @@ -582,6 +587,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x019f, .part_id = 0x8363, .name_prefix = "Left", + .is_amp = true, .dais = { { .direction = {true, false}, @@ -622,6 +628,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x01fa, .part_id = 0x3556, .name_prefix = "AMP", + .is_amp = true, .dais = { { .direction = {true, false}, @@ -650,6 +657,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x01fa, .part_id = 0x3557, .name_prefix = "AMP", + .is_amp = true, .dais = { { .direction = {true, false}, @@ -678,6 +686,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x01fa, .part_id = 0x3563, .name_prefix = "AMP", + .is_amp = true, .dais = { { .direction = {true, false}, @@ -989,6 +998,7 @@ struct asoc_sdw_codec_info codec_info_list[] = { .vendor_id = 0x0105, .part_id = 0x55aa, /* amplifier mockup */ .name_prefix = "sdw_mockup_amp1", + .is_amp = true, .version_id = 0, .dais = { { From 0305c084acf2ba9465acf6b5816bea441fe08b58 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Fri, 5 Jun 2026 18:18:05 +0800 Subject: [PATCH 2/2] ASoC: SOF: Intel: Use codec_info_list.is_amp directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now we set is_amp to all amp type codecs. We can use the flag directly instead of using a local flag to check if the codec is an AMP type. Signed-off-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Charles Keepax Link: https://patch.msgid.link/20260605101805.121428-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/sof/intel/hda.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 8662b422eb80..dc85903b8d46 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1159,7 +1159,6 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev, struct snd_soc_acpi_adr_device *adr_dev; const char *name_prefix = ""; int index = link->num_adr; - bool is_amp = true; /* Set it to false if the codec wiah any NON-AMP DAI type */ int ep_index = 0; int i, j; @@ -1216,7 +1215,6 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev, endpoints[ep_index].aggregated = 0; endpoints[ep_index].group_id = 0; endpoints[ep_index].group_position = 0; - is_amp = false; } ep_index++; } @@ -1230,16 +1228,6 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev, return NULL; } - /* - * codec_info_list[].is_amp is a codec-level override: for multi-function - * codecs we must treat the whole codec as an AMP when it is described as - * such in the codec info table, even if some endpoints were detected as - * non-AMP above. Callers/UCM rely on this to keep name_prefix and AMP - * indexing stable and backwards compatible. - */ - if (codec_info_list[i].is_amp) - is_amp = true; - adr_dev[index].adr = ((u64)sdw_device->id.class_id & 0xFF) | ((u64)sdw_device->id.part_id & 0xFFFF) << 8 | ((u64)sdw_device->id.mfg_id & 0xFFFF) << 24 | @@ -1247,7 +1235,7 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev, ((u64)(sdw_device->id.sdw_version & 0xF) << 44) | ((u64)(sdw_device->bus->link_id & 0xF) << 48); - if (!is_amp) { + if (!codec_info_list[i].is_amp) { /* For non-amp codecs, get name_prefix from codec_info_list[] */ adr_dev[index].name_prefix = devm_kasprintf(dev, GFP_KERNEL, "%s", name_prefix); goto done_name_prefix;