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>
This commit is contained in:
Chunfeng Yun
2019-03-21 10:53:46 +08:00
committed by Greg Kroah-Hartman
parent 48e0d3735a
commit ae07809255
7 changed files with 503 additions and 13 deletions

View File

@@ -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__ */