xref: /linux/drivers/usb/mtu3/mtu3_debug.h (revision 16eb9c0aae8da3ade9bb74464c2e3d151a39d504)
14d49d352SNishad Kamdar /* SPDX-License-Identifier: GPL-2.0 */
2ae078092SChunfeng Yun /*
3ae078092SChunfeng Yun  * mtu3_debug.h - debug header
4ae078092SChunfeng Yun  *
5ae078092SChunfeng Yun  * Copyright (C) 2019 MediaTek Inc.
6ae078092SChunfeng Yun  *
7ae078092SChunfeng Yun  * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8ae078092SChunfeng Yun  */
9ae078092SChunfeng Yun 
10ae078092SChunfeng Yun #ifndef __MTU3_DEBUG_H__
11ae078092SChunfeng Yun #define __MTU3_DEBUG_H__
12ae078092SChunfeng Yun 
13ae078092SChunfeng Yun #include <linux/debugfs.h>
14ae078092SChunfeng Yun 
15*16eb9c0aSLee Jones struct ssusb_mtk;
16*16eb9c0aSLee Jones 
17ae078092SChunfeng Yun #define MTU3_DEBUGFS_NAME_LEN 32
18ae078092SChunfeng Yun 
19ae078092SChunfeng Yun struct mtu3_regset {
20ae078092SChunfeng Yun 	char name[MTU3_DEBUGFS_NAME_LEN];
21ae078092SChunfeng Yun 	struct debugfs_regset32 regset;
22ae078092SChunfeng Yun 	size_t nregs;
23ae078092SChunfeng Yun };
24ae078092SChunfeng Yun 
25ae078092SChunfeng Yun struct mtu3_file_map {
26ae078092SChunfeng Yun 	const char *name;
27ae078092SChunfeng Yun 	int (*show)(struct seq_file *s, void *unused);
28ae078092SChunfeng Yun };
29ae078092SChunfeng Yun 
30ae078092SChunfeng Yun #if IS_ENABLED(CONFIG_DEBUG_FS)
31ae078092SChunfeng Yun void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb);
324aab6ad2SChunfeng Yun void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb);
33ae078092SChunfeng Yun void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb);
34ae078092SChunfeng Yun void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb);
35ae078092SChunfeng Yun 
36ae078092SChunfeng Yun #else
37ae078092SChunfeng Yun static inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {}
384aab6ad2SChunfeng Yun static inline void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb) {}
39ae078092SChunfeng Yun static inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {}
40ae078092SChunfeng Yun static inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {}
41ae078092SChunfeng Yun 
42ae078092SChunfeng Yun #endif /* CONFIG_DEBUG_FS */
43ae078092SChunfeng Yun 
4483374e03SChunfeng Yun #if IS_ENABLED(CONFIG_TRACING)
4583374e03SChunfeng Yun void mtu3_dbg_trace(struct device *dev, const char *fmt, ...);
4683374e03SChunfeng Yun 
4783374e03SChunfeng Yun #else
4883374e03SChunfeng Yun static inline void mtu3_dbg_trace(struct device *dev, const char *fmt, ...) {}
4983374e03SChunfeng Yun 
5083374e03SChunfeng Yun #endif /* CONFIG_TRACING */
5183374e03SChunfeng Yun 
52ae078092SChunfeng Yun #endif /* __MTU3_DEBUG_H__ */
53