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 }; 23ae078092SChunfeng Yun 24ae078092SChunfeng Yun struct mtu3_file_map { 25ae078092SChunfeng Yun const char *name; 26ae078092SChunfeng Yun int (*show)(struct seq_file *s, void *unused); 27ae078092SChunfeng Yun }; 28ae078092SChunfeng Yun 29ae078092SChunfeng Yun #if IS_ENABLED(CONFIG_DEBUG_FS) 30ae078092SChunfeng Yun void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb); 314aab6ad2SChunfeng Yun void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb); 32ae078092SChunfeng Yun void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb); 33ae078092SChunfeng Yun void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb); 34ae078092SChunfeng Yun 35ae078092SChunfeng Yun #else ssusb_dev_debugfs_init(struct ssusb_mtk * ssusb)36ae078092SChunfeng Yunstatic inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {} ssusb_dr_debugfs_init(struct ssusb_mtk * ssusb)374aab6ad2SChunfeng Yunstatic inline void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb) {} ssusb_debugfs_create_root(struct ssusb_mtk * ssusb)38ae078092SChunfeng Yunstatic inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {} ssusb_debugfs_remove_root(struct ssusb_mtk * ssusb)39ae078092SChunfeng Yunstatic inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {} 40ae078092SChunfeng Yun 41ae078092SChunfeng Yun #endif /* CONFIG_DEBUG_FS */ 42ae078092SChunfeng Yun 4383374e03SChunfeng Yun #if IS_ENABLED(CONFIG_TRACING) 4483374e03SChunfeng Yun void mtu3_dbg_trace(struct device *dev, const char *fmt, ...); 4583374e03SChunfeng Yun 4683374e03SChunfeng Yun #else mtu3_dbg_trace(struct device * dev,const char * fmt,...)4783374e03SChunfeng Yunstatic inline void mtu3_dbg_trace(struct device *dev, const char *fmt, ...) {} 4883374e03SChunfeng Yun 4983374e03SChunfeng Yun #endif /* CONFIG_TRACING */ 5083374e03SChunfeng Yun 51ae078092SChunfeng Yun #endif /* __MTU3_DEBUG_H__ */ 52