Skip to content

Find codec driver by SoundWire address instead of guessing the name - #5927

Draft
rfvirgil wants to merge 3 commits into
thesofproject:topic/sof-devfrom
CirrusLogic:topic/snd_soc_lookup_component_walk
Draft

Find codec driver by SoundWire address instead of guessing the name#5927
rfvirgil wants to merge 3 commits into
thesofproject:topic/sof-devfrom
CirrusLogic:topic/snd_soc_lookup_component_walk

Conversation

@rfvirgil

@rfvirgil rfvirgil commented Sep 8, 2026

Copy link
Copy Markdown

This series adds a walk function to ASoC so sof_sdw can find the codec driver by matching its SoundWire address instead of trying to guess the name of the codec driver.

The struct sdw_bus * argument to sdw_extract_slave_id() is entirely bogus,
and isn't needed for the ID conversion that this helper function performs.

Also provide a stub implementation for !CONFIG_SOUNDWIRE so that callers
can use if (!IS_REACHABLE(CONFIG_SOUNDWIRE)) style instead of having to be
surrounded by #ifdefs.

The bus argument was only used to get a struct device * for two dev_dbg()
statements. This forced callers to have a valid struct sdw_bus object just
to convert an ID from u64 to struct sdw_slave_id.

The debug print is now a utility function sdw_debug_log_slave_id() that
can be used anywhere and only requires a struct device *.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Add a function to walk the component list and call a callback for
each component. This lest the machine driver implement its own
component match.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
…ddress

Use snd_soc_lookup_component_walk() to find the codec for the SoundWire
address instead of trying to guess the name of the codec driver.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
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.

1 participant