mtu3_debug.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* 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 <[email protected]>
  8. */
  9. #ifndef __MTU3_DEBUG_H__
  10. #define __MTU3_DEBUG_H__
  11. #include <linux/debugfs.h>
  12. struct ssusb_mtk;
  13. #define MTU3_DEBUGFS_NAME_LEN 32
  14. struct mtu3_regset {
  15. char name[MTU3_DEBUGFS_NAME_LEN];
  16. struct debugfs_regset32 regset;
  17. };
  18. struct mtu3_file_map {
  19. const char *name;
  20. int (*show)(struct seq_file *s, void *unused);
  21. };
  22. #if IS_ENABLED(CONFIG_DEBUG_FS)
  23. void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb);
  24. void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb);
  25. void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb);
  26. void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb);
  27. #else
  28. static inline void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb) {}
  29. static inline void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb) {}
  30. static inline void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb) {}
  31. static inline void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb) {}
  32. #endif /* CONFIG_DEBUG_FS */
  33. #if IS_ENABLED(CONFIG_TRACING)
  34. void mtu3_dbg_trace(struct device *dev, const char *fmt, ...);
  35. #else
  36. static inline void mtu3_dbg_trace(struct device *dev, const char *fmt, ...) {}
  37. #endif /* CONFIG_TRACING */
  38. #endif /* __MTU3_DEBUG_H__ */