snd_debug_proc.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * snd_debug_proc.h - header for SAMSUNG Audio debugging.
  4. */
  5. #ifndef _SND_DEBUG_PROC_H
  6. #define _SND_DEBUG_PROC_H
  7. #include <linux/mutex.h>
  8. #include <linux/sizes.h>
  9. #include <linux/err.h>
  10. #include <linux/init.h>
  11. #include <linux/module.h>
  12. #include <linux/of.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/slab.h>
  15. #include <linux/time.h>
  16. #include <linux/uaccess.h>
  17. #include <linux/wait.h>
  18. #include <linux/timer.h>
  19. #include <linux/proc_fs.h>
  20. #include <linux/rtc.h>
  21. #include <linux/sched/clock.h>
  22. #if IS_ENABLED(CONFIG_SEC_KUNIT)
  23. #include <kunit/test.h>
  24. #include <kunit/mock.h>
  25. #else
  26. #define __visible_for_testing static
  27. #endif
  28. #define AUD_LOG_BUF_SIZE SZ_64K
  29. #define MAX_LOG_LINE_LEN 256
  30. #define PROC_SDP_DIR "snd_debug_proc"
  31. #define SDP_INFO_LOG_NAME "sdp_info_log"
  32. #define SDP_BOOT_LOG_NAME "sdp_boot_log"
  33. struct snd_debug_proc {
  34. char log_buf[AUD_LOG_BUF_SIZE];
  35. bool is_enabled;
  36. unsigned int buf_pos;
  37. unsigned int buf_full;
  38. struct mutex lock;
  39. void (*save_log)(char *buf, int len);
  40. };
  41. #if IS_ENABLED(CONFIG_SND_SOC_SAMSUNG_AUDIO)
  42. void sdp_info_print(const char *fmt, ...);
  43. void sdp_boot_print(const char *fmt, ...);
  44. struct snd_debug_proc *get_sdp_info(void);
  45. struct snd_debug_proc *get_sdp_boot(void);
  46. #else
  47. inline void sdp_info_print(const char *fmt, ...)
  48. {
  49. }
  50. inline void sdp_boot_print(const char *fmt, ...)
  51. {
  52. }
  53. inline struct snd_debug_proc *get_sdp_info(void)
  54. {
  55. return NULL;
  56. }
  57. inline struct snd_debug_proc *get_sdp_boot(void)
  58. {
  59. return NULL;
  60. }
  61. #endif
  62. #endif