ARM: mali400: r5p2_rel0: add sc8830 platform codes
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / drivers / sensor / bs_log.h
1 /*
2  * (C) Copyright 2013 Bosch Sensortec GmbH All Rights Reserved
3  *
4  * This software program is licensed subject to the GNU General Public License
5  * (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html
6  *
7  * @date        Apr 28th, 2011
8  * @version     v1.0
9  * @brief       Log API for Bosch MEMS Sensor drivers
10  */
11
12 #ifndef __BS_LOG_H
13 #define __BS_LOG_H
14
15 #include <linux/kernel.h>
16
17 #define LOG_LEVEL_E 3
18 #define LOG_LEVEL_N 5
19 #define LOG_LEVEL_I 6
20 #define LOG_LEVEL_D 7
21
22 #ifndef LOG_LEVEL
23 #define LOG_LEVEL LOG_LEVEL_I
24 #endif
25
26 #ifndef MODULE_TAG
27 #define MODULE_TAG "<>"
28 #endif
29
30 #if (LOG_LEVEL >= LOG_LEVEL_E)
31 #define PERR(fmt, args...) printk(KERN_ERR\
32                 "\n" "[E]" KERN_ERR MODULE_TAG "<%s><%d>" fmt "\n",\
33                 __func__, __LINE__, ##args)
34 #else
35 #define PERR(fmt, args...)
36 #endif
37
38 #if (LOG_LEVEL >= LOG_LEVEL_N)
39 #define PNOTICE(fmt, args...) printk(KERN_NOTICE\
40                 "\n" "[N]" KERN_NOTICE MODULE_TAG "<%s><%d>" fmt "\n",\
41                 __func__, __LINE__, ##args)
42 #else
43 #define PNOTICE(fmt, args...)
44 #endif
45
46 #if (LOG_LEVEL >= LOG_LEVEL_I)
47 #define PINFO(fmt, args...) printk(KERN_INFO\
48                 "\n" "[I]" KERN_INFO MODULE_TAG "<%s><%d>" fmt "\n",\
49                 __func__, __LINE__, ##args)
50 #else
51 #define PINFO(fmt, args...)
52 #endif
53
54 #if (LOG_LEVEL >= LOG_LEVEL_D)
55 #define PDEBUG(fmt, args...) printk(KERN_DEBUG\
56                 "\n" "[D]" KERN_DEBUG MODULE_TAG "<%s><%d>" fmt "\n",\
57                 __func__, __LINE__, ##args)
58 #else
59 #define PDEBUG(fmt, args...)
60 #endif
61
62 #endif