blob: 119206b715dcd7de4018f3f3e99d72209dc431b0 [file] [log] [blame]
Junzhe Zou26abf772017-07-05 10:36:43 -07001/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
Junzhe Zou263a87d2017-06-08 16:06:25 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _CAM_DEBUG_UTIL_H_
14#define _CAM_DEBUG_UTIL_H_
15
16#define DEFAULT 0xFFFF
17#define CAM_CDM (1 << 0)
18#define CAM_CORE (1 << 1)
19#define CAM_CPAS (1 << 2)
20#define CAM_ISP (1 << 3)
21#define CAM_CRM (1 << 4)
22#define CAM_SENSOR (1 << 5)
23#define CAM_SMMU (1 << 6)
24#define CAM_SYNC (1 << 7)
25#define CAM_ICP (1 << 8)
26#define CAM_JPEG (1 << 9)
27#define CAM_FD (1 << 10)
28#define CAM_LRME (1 << 11)
29
30#define GROUP DEFAULT
31#define TRACE_ON 0
32
33#define CAM_ERR(__module, fmt, args...) \
34 do { if (GROUP & __module) { \
35 if (TRACE_ON) \
36 trace_printk(fmt, ##args); \
37 else \
38 pr_err(fmt, ##args); \
39 } } while (0)
40
41#define CAM_WARN(__module, fmt, args...) \
42 do { if (GROUP & __module) { \
43 if (TRACE_ON) \
44 trace_printk(fmt, ##args); \
45 else \
46 pr_warn(fmt, ##args); \
47 } } while (0)
48
49#define CAM_INFO(__module, fmt, args...) \
50 do { if (GROUP & __module) { \
51 if (TRACE_ON) \
52 trace_printk(fmt, ##args); \
53 else \
54 pr_info(fmt, ##args); \
55 } } while (0)
56
57#endif /* _CAM_DEBUG_UTIL_H_ */