Skip to content

soundwire: debugfs: add root-level peripherals table#5738

Open
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:sdw-debugfs
Open

soundwire: debugfs: add root-level peripherals table#5738
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:sdw-debugfs

Conversation

@bardliao
Copy link
Copy Markdown
Collaborator

The table will let user know what peripherals are listed and get the detected status by the dev_num.

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

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/peripherals debugfs file that iterates over all sdw_master_device instances.
  • 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"
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