xref: /OK3568_Linux_fs/kernel/sound/soc/codecs/aw883xx/aw_log.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 #ifndef __AWINIC_LOG_H__
4 #define __AWINIC_LOG_H__
5 
6 /********************************************
7  * print information control
8  *******************************************/
9 #define aw_dev_err(dev, format, ...) \
10 	do { \
11 		pr_err("[Awinic][%s]%s: " format "\n", dev_name(dev), __func__, ##__VA_ARGS__); \
12 	} while (0)
13 #ifdef AW_INFO_LOG_ENABLE
14 #define aw_dev_info(dev, format, ...) \
15 	do { \
16 		pr_info("[Awinic][%s]%s: " format "\n", dev_name(dev), __func__, ##__VA_ARGS__); \
17 	} while (0)
18 #else
19 #define aw_dev_info(dev, format, ...) \
20 	do { \
21 		pr_debug("[Awinic][%s]%s: " format "\n", dev_name(dev), __func__, ##__VA_ARGS__); \
22 	} while (0)
23 #endif
24 
25 #define aw_dev_dbg(dev, format, ...) \
26 	do { \
27 		pr_debug("[Awinic][%s]%s: " format "\n", dev_name(dev), __func__, ##__VA_ARGS__); \
28 	} while (0)
29 
30 #define aw_pr_err(format, ...) \
31 	do { \
32 		pr_err("[Awinic]%s: " format "\n", __func__, ##__VA_ARGS__); \
33 	} while (0)
34 #ifdef AW_INFO_LOG_ENABLE
35 #define aw_pr_info(format, ...) \
36 	do { \
37 		pr_info("[Awinic]%s: " format "\n", __func__, ##__VA_ARGS__); \
38 	} while (0)
39 
40 #else
41 #define aw_pr_info(format, ...) \
42 	do { \
43 		pr_debug("[Awinic]%s: " format "\n", __func__, ##__VA_ARGS__); \
44 	} while (0)
45 #endif
46 
47 #define aw_pr_dbg(format, ...) \
48 	do { \
49 		pr_debug("[Awinic]%s: " format "\n", __func__, ##__VA_ARGS__); \
50 	} while (0)
51 
52 
53 #endif
54 
55