[SRU][R][PATCH 2/3] ASoC: SOF: Intel: Add a is_amp flag to fix the wrong name prefix
Aaron Ma
aaron.ma at canonical.com
Mon Apr 27 06:19:33 UTC 2026
From: Derek Fang <derek.fang at realtek.com>
BugLink: https://bugs.launchpad.net/bugs/2150196
According to the Intel sof design, it will create the name prefix
appended with amp index for the amp codec only, such as:
rt1318-1, rt1318-2, etc...
But the rt1320 is a codec with amp and mic codec functions, it doesn't
have the amp index in its name prefix as above.
And then it will be hard to identify the codec if in multi-rt1320 case.
So we add a flag to force the amp index to be appended.
Signed-off-by: Derek Fang <derek.fang at realtek.com>
Signed-off-by: Bard Liao <yung-chuan.liao at linux.intel.com>
Link: https://patch.msgid.link/20260326075303.1083567-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie at kernel.org>
(cherry picked from commit dd4a1963ddf0d0f5e129efec03f34ea37109b4b7)
Signed-off-by: Aaron Ma <aaron.ma at canonical.com>
---
include/sound/soc_sdw_utils.h | 2 ++
sound/soc/sof/intel/hda.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h
index 227347c8f0b33..6726c63ad50c2 100644
--- a/include/sound/soc_sdw_utils.h
+++ b/include/sound/soc_sdw_utils.h
@@ -82,6 +82,8 @@ struct asoc_sdw_codec_info {
const int dai_num;
struct asoc_sdw_aux_info auxs[SOC_SDW_MAX_AUX_NUM];
const int aux_num;
+ /* Force AMP-style name_prefix handling (append AMP index) even if MIC/Jack DAIs exist */
+ const bool is_amp;
int (*codec_card_late_probe)(struct snd_soc_card *card);
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 8a240dcb7fcb3..ac2ac030f9bb7 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1227,6 +1227,16 @@ 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 |
--
2.43.0
More information about the kernel-team
mailing list