aboutsummaryrefslogtreecommitdiff
path: root/include/linux/lge_display_debug.h
blob: 59c1b90dc090f7c33655e256e36e940c5a22165b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef _LGE_DISPLAY_DEBUG_
#define _LGE_DISPLAY_DEBUG_

#include <linux/kernel.h>
#include <linux/string.h>

enum {
	LEVEL_ERR		= 0,
	LEVEL_WARN,
	LEVEL_INFOR,
	LEVEL_DEBUG,
	LEVEL_MAX,
};

/* Tag string for each funtion */
#define AOD		"[Disp][AOD]"
#define BL		"[Disp][Backlight]"
#define HLB		"[Disp][HL_Backlight]"
#define HDMI	"[Disp][HDMI]"
#define NONE	"[Disp]"

#if defined(CONFIG_LGE_DISPLAY_DYNAMIC_LOG)
extern uint32_t display_debug_level;
#define DISP_ERR(tag, fmt, args...)			\
	do {							\
		if (display_debug_level >= LEVEL_ERR)	\
			pr_err(tag fmt, ##args);	\
	} while (0)

#define DISP_WARN(tag, fmt, args...)			\
	do {							\
		if (display_debug_level >= LEVEL_WARN) \
			pr_err(tag fmt, ##args);	\
	} while (0)

#define DISP_INFO(tag, fmt, args...)			\
	do {							\
		if (display_debug_level >= LEVEL_INFOR)	\
			pr_err(tag fmt, ##args);	\
	} while (0)

#define DISP_DEBUG(tag, fmt, args...)			\
	do {							\
		if (display_debug_level >= LEVEL_DEBUG) \
			pr_err(tag fmt, ##args);	\
	} while (0)
#else
#define DISP_ERR(tag, fmt, args...)			\
	do {							\
		if (false)	\
			pr_err(tag fmt, ##args);	\
	} while (0)

#define DISP_WARN(tag, fmt, args...)			\
	do {							\
		if (false) \
			pr_err(tag fmt, ##args);	\
	} while (0)

#define DISP_INFO(tag, fmt, args...)			\
	do {							\
		if (false)	\
			pr_err(tag fmt, ##args);	\
	} while (0)

#define DISP_DEBUG(tag, fmt, args...)			\
	do {							\
		if (false) \
			pr_err(tag fmt, ##args);	\
	} while (0)
#endif
#endif