soundwire: debugfs: add root-level peripherals table#5738
Open
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
Open
soundwire: debugfs: add root-level peripherals table#5738bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
Conversation
The table will let user know what peripherals are listed and get the detected status by the dev_num. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
Adds a root-level debugfs view under soundwire/ to list SoundWire peripherals across all masters/links, intended to make it easier to discover devices and correlate them with dev_num.
Changes:
- Add a new
soundwire/peripheralsdebugfs file that iterates over allsdw_master_deviceinstances. - Implement a table-style dump of per-bus peripherals including name, dev_num, and ID fields.
- Add helper to construct a DisCo-style address value from
sdw_slave_id.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+54
to
+60
| addr = sdw_slave_addr_from_id(bus, &slave->id); | ||
| seq_printf(s_file, SDW_PERIPH_ENTRY_FMT, | ||
| dev_name(&slave->dev), slave->dev_num, | ||
| addr, | ||
| slave->id.mfg_id, slave->id.part_id, | ||
| slave->id.class_id, slave->id.unique_id, | ||
| slave->id.sdw_version); |
Comment on lines
+46
to
+51
| seq_printf(s_file, "master-%d-%d\n", | ||
| bus->controller_id, bus->link_id); | ||
| seq_printf(s_file, SDW_PERIPH_HEADER_FMT, | ||
| "name", "dev_num", "addr", "mfg_id", "part_id", | ||
| "class_id", "unique_id", "sdw_version"); | ||
|
|
Comment on lines
+19
to
+20
| #define SDW_PERIPH_HEADER_FMT "%-28s %-7s %-16s %-6s %-7s %-8s %-9s %-11s\n" | ||
| #define SDW_PERIPH_ENTRY_FMT "%-28s %-7u %#016llx %-6.4x %-7.4x %-8.2x %-9.2x %-11.1x\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The table will let user know what peripherals are listed and get the detected status by the dev_num.