summaryrefslogtreecommitdiffstats
path: root/drivers/usb/mtu3/mtu3_debug.h
diff options
context:
space:
mode:
authorChunfeng Yun2019-03-21 03:53:46 +0100
committerGreg Kroah-Hartman2019-03-26 08:40:14 +0100
commitae07809255d3e3419205b673aba6d1dce16a0d65 (patch)
treedc2654cbad0618874d5476dcfa84f10ae5e19754 /drivers/usb/mtu3/mtu3_debug.h
parentusb: mtu3: supports new QMU format (diff)
downloadkernel-qcow2-linux-ae07809255d3e3419205b673aba6d1dce16a0d65.tar.gz
kernel-qcow2-linux-ae07809255d3e3419205b673aba6d1dce16a0d65.tar.xz
kernel-qcow2-linux-ae07809255d3e3419205b673aba6d1dce16a0d65.zip
usb: mtu3: add debugfs interface files
This adds more debugfs consumers. The debugfs entries read some important registers, fifo status, QMU ring, endpoint status, and IPPC probe interface to get internal status. With these entries, users can check the registers, endpoint and GPD used during run time. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/mtu3/mtu3_debug.h')
-rw-r--r--drivers/usb/mtu3/mtu3_debug.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/usb/mtu3/mtu3_debug.h b/drivers/usb/mtu3/mtu3_debug.h
new file mode 100644
index 000000000000..94d39b00403e
--- /dev/null
+++ b/drivers/usb/mtu3/mtu3_debug.h
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * mtu3_debug.h - debug header
+ *
+ * Copyright (C) 2019 MediaTek Inc.
+ *
+ * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
+ */
+
+#ifndef __MTU3_DEBUG_H__
+#define __MTU3_DEBUG_H__
+
+#include <linux/debugfs.h>
+
+#define MTU3_DEBUGFS_NAME_LEN 32
+
+struct mtu3_regset {
+ char name[MTU3_DEBUGFS_NAME_LEN];
+ struct debugfs_regset32 regset;
+ size_t nregs;
+};
+
+struct mtu3_file_map {
+ const char *name;
+ int (*show)(struct seq_file *s, void *unused);
+};
+
+#if IS_ENABLED(CONFIG_DEBUG_FS)
+void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb);
+void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb);
+void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb);
+
+#else
+static inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {}
+static inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {}
+static inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {}
+
+#endif /* CONFIG_DEBUG_FS */
+
+#endif /* __MTU3_DEBUG_H__ */