Skip to content

ASoC: partial match the sdca codec name#5664

Open
bardliao wants to merge 3 commits intothesofproject:topic/sof-devfrom
bardliao:sdca_codec_name_index
Open

ASoC: partial match the sdca codec name#5664
bardliao wants to merge 3 commits intothesofproject:topic/sof-devfrom
bardliao:sdca_codec_name_index

Conversation

@bardliao
Copy link
Collaborator

@bardliao bardliao commented Feb 6, 2026

Currently, we set a predefined codec component name in a DAI link. But the codec name may contain an index which is not fixed. This series suggest using partial match the codec name to fix the issue.

Add a helper to help user to get the component by name.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
if (dai_info->codec_name) {
struct snd_soc_component *component;

component = snd_soc_lookup_component_by_name(dai_info->codec_name);

Choose a reason for hiding this comment

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

Can we be sure the component exists by this point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can we be sure the component exists by this point?

No, but in theory, the function will be called again when the component probed and be registered.

@charleskeepax
Copy link

Ok well it mostly works for me, will investigate the probe concerns a little more. One thing that is missing though is the handling of aux devices on the link, we added very basic support for this for the HID device and it would also need renaming.

@bardliao
Copy link
Collaborator Author

bardliao commented Feb 6, 2026

Ok well it mostly works for me, will investigate the probe concerns a little more. One thing that is missing though is the handling of aux devices on the link, we added very basic support for this for the HID device and it would also need renaming.

Oh, yes, I missed soc_aux->dlc.name.

Currently, we can set codec name in the dai info which will be set as
the codec component name in a DAI link. However, the codec name may
not be fixed. For example, there is an index in a SDCA codec name and
that is not fixed. Lookup the fixed codec name string from the component
list to get the right component name to ensure the DAI link will bind
to the right codec component.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The index is not fixed and it will lead to the DAI link can't bind the
codec component with the name when the index is different from the
predefined one.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao bardliao force-pushed the sdca_codec_name_index branch from 3495316 to e4b195e Compare February 6, 2026 13:16
Copy link

@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.

Ok I think this looks good to me and it tests out fine on my setup here even with the function disabled as it is on the customer system.
EDIT: Also thank you very much for having a look at this, been quite slammed at the moment and it's a big help.

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.

2 participants