18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * mtu3_debug.h - debug header
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2019 MediaTek Inc.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __MTU3_DEBUG_H__
118c2ecf20Sopenharmony_ci#define __MTU3_DEBUG_H__
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/debugfs.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistruct ssusb_mtk;
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define MTU3_DEBUGFS_NAME_LEN 32
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_cistruct mtu3_regset {
208c2ecf20Sopenharmony_ci	char name[MTU3_DEBUGFS_NAME_LEN];
218c2ecf20Sopenharmony_ci	struct debugfs_regset32 regset;
228c2ecf20Sopenharmony_ci	size_t nregs;
238c2ecf20Sopenharmony_ci};
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_cistruct mtu3_file_map {
268c2ecf20Sopenharmony_ci	const char *name;
278c2ecf20Sopenharmony_ci	int (*show)(struct seq_file *s, void *unused);
288c2ecf20Sopenharmony_ci};
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_DEBUG_FS)
318c2ecf20Sopenharmony_civoid ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb);
328c2ecf20Sopenharmony_civoid ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb);
338c2ecf20Sopenharmony_civoid ssusb_debugfs_create_root(struct ssusb_mtk *ssusb);
348c2ecf20Sopenharmony_civoid ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#else
378c2ecf20Sopenharmony_cistatic inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {}
388c2ecf20Sopenharmony_cistatic inline void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb) {}
398c2ecf20Sopenharmony_cistatic inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {}
408c2ecf20Sopenharmony_cistatic inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {}
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#endif /* CONFIG_DEBUG_FS */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_TRACING)
458c2ecf20Sopenharmony_civoid mtu3_dbg_trace(struct device *dev, const char *fmt, ...);
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#else
488c2ecf20Sopenharmony_cistatic inline void mtu3_dbg_trace(struct device *dev, const char *fmt, ...) {}
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif /* CONFIG_TRACING */
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#endif /* __MTU3_DEBUG_H__ */
53