summaryrefstree
path: root/kernel/techpack/display/include/linux/secdp_logger.h
blob: 577d3da6cb9d1cbd0c8bbc659cd9ce864b0dd767 (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
73
74
#ifndef _SECDP_LOGGER_H_
#define _SECDP_LOGGER_H_

#ifdef CONFIG_SEC_DISPLAYPORT_LOGGER

void secdp_logger_set_max_count(int count);
void secdp_logger_print(const char *fmt, ...);
void secdp_logger_hex_dump(void *buf, void *pref, size_t len);
int secdp_logger_init(void);

#define secdp_proc_info(fmt, ...) \
	do { \
		printk(KERN_INFO "[msm-dp] %s: " pr_fmt(fmt), __func__, ##__VA_ARGS__); \
		secdp_logger_print(fmt, ##__VA_ARGS__); \
	} while (0)

#define secdp_pr_info(fmt, ...) \
		printk(KERN_INFO "[msm-dp] %s: " pr_fmt(fmt), __func__, ##__VA_ARGS__)

#ifdef pr_debug
#undef pr_debug
#define pr_debug	secdp_pr_info
#endif
#ifdef DEV_DBG
#undef DEV_DBG
#define DEV_DBG		secdp_pr_info
#endif

#ifdef pr_err
#undef pr_err
#define pr_err		secdp_proc_info
#endif
#ifdef DEV_ERR
#undef DEV_ERR
#define DEV_ERR		secdp_proc_info
#endif

#ifdef pr_info
#undef pr_info
#define pr_info		secdp_proc_info
#endif
#ifdef DEV_INFO
#undef DEV_INFO
#define DEV_INFO	secdp_proc_info
#endif

#ifdef pr_warn
#undef pr_warn
#define pr_warn		secdp_proc_info
#endif
#ifdef DEV_WARN
#undef DEV_WARN
#define DEV_WARN	secdp_proc_info
#endif

#else/* !CONFIG_SEC_DISPLAYPORT_LOGGER */

#define secdp_logger_set_max_count(x)			do {} while (0)
#define secdp_logger_print(fmt, ...)			do {} while (0)
#define secdp_logger_hex_dump(buf, pref, len)		do {} while (0)
#define secdp_logger_init(void)				do {} while (0)

#ifdef pr_debug
#undef pr_debug
#define pr_debug	pr_info
#endif
#ifdef DEV_DBG
#undef DEV_DBG
#define DEV_DBG		pr_info
#endif

#endif

#endif/*_SECDP_LOGGER_H_*/