blob: e96a69234d05f5a5357ad532100dd663bbb210b0 [file] [log] [blame]
Chunfeng Yunae078092019-03-21 10:53:46 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * mtu3_debug.h - debug header
4 *
5 * Copyright (C) 2019 MediaTek Inc.
6 *
7 * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8 */
9
10#ifndef __MTU3_DEBUG_H__
11#define __MTU3_DEBUG_H__
12
13#include <linux/debugfs.h>
14
15#define MTU3_DEBUGFS_NAME_LEN 32
16
17struct mtu3_regset {
18 char name[MTU3_DEBUGFS_NAME_LEN];
19 struct debugfs_regset32 regset;
20 size_t nregs;
21};
22
23struct mtu3_file_map {
24 const char *name;
25 int (*show)(struct seq_file *s, void *unused);
26};
27
28#if IS_ENABLED(CONFIG_DEBUG_FS)
29void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb);
Chunfeng Yun4aab6ad2019-03-21 10:53:47 +080030void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb);
Chunfeng Yunae078092019-03-21 10:53:46 +080031void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb);
32void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb);
33
34#else
35static inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {}
Chunfeng Yun4aab6ad2019-03-21 10:53:47 +080036static inline void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb) {}
Chunfeng Yunae078092019-03-21 10:53:46 +080037static inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {}
38static inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {}
39
40#endif /* CONFIG_DEBUG_FS */
41
Chunfeng Yun83374e02019-03-21 10:53:48 +080042#if IS_ENABLED(CONFIG_TRACING)
43void mtu3_dbg_trace(struct device *dev, const char *fmt, ...);
44
45#else
46static inline void mtu3_dbg_trace(struct device *dev, const char *fmt, ...) {}
47
48#endif /* CONFIG_TRACING */
49
Chunfeng Yunae078092019-03-21 10:53:46 +080050#endif /* __MTU3_DEBUG_H__ */