Skip to content

ASoC: Use codec_info_list.is_amp directly in find_acpi_adr_device()#5800

Merged
bardliao merged 2 commits into
thesofproject:topic/sof-devfrom
bardliao:amp-type
Jun 4, 2026
Merged

ASoC: Use codec_info_list.is_amp directly in find_acpi_adr_device()#5800
bardliao merged 2 commits into
thesofproject:topic/sof-devfrom
bardliao:amp-type

Conversation

@bardliao
Copy link
Copy Markdown
Collaborator

@bardliao bardliao commented Jun 3, 2026

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.

bardliao added 2 commits June 3, 2026 09:10
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_amp tracking in find_acpi_adr_device() and use codec_info_list[i].is_amp directly to select AMP vs non-AMP name_prefix handling.
  • Mark additional AMP-type entries in codec_info_list[] with .is_amp = true so 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.

Comment thread sound/soc/sof/intel/hda.c
* indexing stable and backwards compatible.
*/
if (codec_info_list[i].is_amp)
is_amp = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_amp remain to be set for multi-function devices, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@charleskeepax charleskeepax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@bardliao bardliao merged commit 001d86e into thesofproject:topic/sof-dev Jun 4, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants