Add base debugfs mechanism for SoundWire bus by creating soundwire root and master-N and slave-x hierarchy. Also add SDW Slave SCP, DP0 and DP-N register debug file. Registers not implemented will print as "XX" Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah.
Showing the changes to include/linux (1 of 7 files). Show all
Unified · Split
| @@ -542,6 +542,7 @@ struct sdw_slave_ops { · 541 unmodified lines | ||
| 542 | 542 | * @bus: Bus handle |
| 543 | 543 | * @ops: Slave callback ops |
| 544 | 544 | * @prop: Slave properties |
| 545 | + * @debugfs: Slave debugfs | |
| 545 | 546 | * @node: node for bus list |
| 546 | 547 | * @port_ready: Port ready completion flag for each Slave port |
| 547 | 548 | * @dev_num: Device Number assigned by Bus |
| @@ -553,6 +554,9 @@ struct sdw_slave { · 5 unmodified lines | ||
| 553 | 554 | struct sdw_bus *bus; |
| 554 | 555 | const struct sdw_slave_ops *ops; |
| 555 | 556 | struct sdw_slave_prop prop; |
| 557 | +#ifdef CONFIG_DEBUG_FS | |
| 558 | + struct dentry *debugfs; | |
| 559 | +#endif | |
| 556 | 560 | struct list_head node; |
| 557 | 561 | struct completion *port_ready; |
| 558 | 562 | u16 dev_num; |
| @@ -729,6 +733,7 @@ struct sdw_master_ops { · 170 unmodified lines | ||
| 729 | 733 | * @m_rt_list: List of Master instance of all stream(s) running on Bus. This |
| 730 | 734 | * is used to compute and program bus bandwidth, clock, frame shape, |
| 731 | 735 | * transport and port parameters |
| 736 | + * @debugfs: Bus debugfs | |
| 732 | 737 | * @defer_msg: Defer message |
| 733 | 738 | * @clk_stop_timeout: Clock stop timeout computed |
| 734 | 739 | * @bank_switch_timeout: Bank switch timeout computed |
| @@ -748,6 +753,9 @@ struct sdw_bus { · 13 unmodified lines | ||
| 748 | 753 | struct sdw_bus_params params; |
| 749 | 754 | struct sdw_master_prop prop; |
| 750 | 755 | struct list_head m_rt_list; |
| 756 | +#ifdef CONFIG_DEBUG_FS | |
| 757 | + struct dentry *debugfs; | |
| 758 | +#endif | |
| 751 | 759 | struct sdw_defer defer_msg; |
| 752 | 760 | unsigned int clk_stop_timeout; |
| 753 | 761 | u32 bank_switch_timeout; |