ASoC: Use codec_info_list.is_amp directly in find_acpi_adr_device()#5800
Conversation
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 <yung-chuan.liao@linux.intel.com>
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 <yung-chuan.liao@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
This PR updates SOF Intel SoundWire ACPI ADR device discovery to rely on the codec table’s codec_info_list[].is_amp flag (now populated for AMP-type codecs) when deciding whether to apply AMP-style name_prefix handling, instead of deriving AMP-ness via a local per-endpoint heuristic.
Changes:
- Remove the local
is_amptracking infind_acpi_adr_device()and usecodec_info_list[i].is_ampdirectly to select AMP vs non-AMPname_prefixhandling. - Mark additional AMP-type entries in
codec_info_list[]with.is_amp = trueso AMP naming/indexing behavior remains correct and stable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sound/soc/sof/intel/hda.c | Switch AMP/non-AMP naming decision to use codec_info_list[].is_amp directly in ACPI ADR device construction. |
| sound/soc/sdw_utils/soc_sdw_utils.c | Populate .is_amp = true for AMP-type codec table entries used by the SOF SoundWire flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * indexing stable and backwards compatible. | ||
| */ | ||
| if (codec_info_list[i].is_amp) | ||
| is_amp = true; |
There was a problem hiding this comment.
is_amp remain to be set for multi-function devices, right?
There was a problem hiding this comment.
We don't set is_amp for the multi-function devices and it will be false by default. In other words, is_amp will be false for multi-function devices.
There was a problem hiding this comment.
but the removed comment said that we must treat the multi-function codecs as AMP, now we are not going to?
Actually if you say that the is_amp never been set then we never complied with this comment?
There was a problem hiding this comment.
but the removed comment said that we must treat the multi-function codecs as AMP, now we are not going to? Actually if you say that the is_amp never been set then we never complied with this comment?
Sorry, I misunderstood your previous question. Yes, is_amp is set for a few multi-function codecs that must be treated as amps. This commit doesn't change it. So, yes the is_amp remains to be set for a few specific multi-function codecs that need to be treated as an amp.
This series sets is_amp to all amp type codecs in codec_info_list[]. So that we can use the flag directly
instead of using a local flag to check if the codec is an AMP type. The flag will be used to set different name_prefix for amp and non-amp codecs.