mtk_dp_debug.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2020 MediaTek Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __MTK_DP_DEBUG_H__
  14. #define __MTK_DP_DEBUG_H__
  15. #include <linux/types.h>
  16. void mtk_dp_debug_enable(bool enable);
  17. bool mtk_dp_debug_get(void);
  18. void mtk_dp_debug(const char *opt);
  19. int mtk_dp_debugfs_init(void);
  20. void mtk_dp_debugfs_deinit(void);
  21. #define DPTXFUNC(fmt, arg...) \
  22. pr_info("[DPTX][%s line:%d]"pr_fmt(fmt), __func__, __LINE__, ##arg)
  23. #define DPTXDBG(fmt, arg...) \
  24. do { \
  25. if (mtk_dp_debug_get()) \
  26. pr_info("[DPTX]"pr_fmt(fmt), ##arg); \
  27. } while (0)
  28. #define DPTXMSG(fmt, arg...) \
  29. pr_info("[DPTX]"pr_fmt(fmt), ##arg)
  30. #define DPTXERR(fmt, arg...) \
  31. pr_err("[DPTX][ERROR]"pr_fmt(fmt), ##arg)
  32. #endif