From bf03473d5bcc85fbe9533fa042f67809d8520c4e Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 21 Aug 2019 13:58:18 -0500 Subject: soundwire: add debugfs support 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. Reviewed-by: Greg Kroah-Hartman Acked-by: Sanyog Kale Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20190821185821.12690-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul --- include/linux/soundwire/sdw.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux/soundwire') diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 131d49ef1cb4..2028318a4c62 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -542,6 +542,7 @@ struct sdw_slave_ops { * @bus: Bus handle * @ops: Slave callback ops * @prop: Slave properties + * @debugfs: Slave debugfs * @node: node for bus list * @port_ready: Port ready completion flag for each Slave port * @dev_num: Device Number assigned by Bus @@ -553,6 +554,9 @@ struct sdw_slave { struct sdw_bus *bus; const struct sdw_slave_ops *ops; struct sdw_slave_prop prop; +#ifdef CONFIG_DEBUG_FS + struct dentry *debugfs; +#endif struct list_head node; struct completion *port_ready; u16 dev_num; @@ -729,6 +733,7 @@ struct sdw_master_ops { * @m_rt_list: List of Master instance of all stream(s) running on Bus. This * is used to compute and program bus bandwidth, clock, frame shape, * transport and port parameters + * @debugfs: Bus debugfs * @defer_msg: Defer message * @clk_stop_timeout: Clock stop timeout computed * @bank_switch_timeout: Bank switch timeout computed @@ -748,6 +753,9 @@ struct sdw_bus { struct sdw_bus_params params; struct sdw_master_prop prop; struct list_head m_rt_list; +#ifdef CONFIG_DEBUG_FS + struct dentry *debugfs; +#endif struct sdw_defer defer_msg; unsigned int clk_stop_timeout; u32 bank_switch_timeout; -- cgit v1.2.3