xref: /OK3568_Linux_fs/kernel/drivers/rkflash/rkflash_debug.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 /* Copyright (c) 2018 Rockchip Electronics Co. Ltd. */
4 
5 #ifndef _RKFLASH_DEBUG_H
6 #define _RKFLASH_DEBUG_H
7 
8 #include <linux/kernel.h>
9 
10 /*
11  * Debug control center
12  * 1. Set Printing-adding-macro to 1 to allow print code being compiled in.
13  * 2. Set variable 'rkflash_debug' to control debug print to enable print.
14  */
15 
16 /*
17  * Printing-adding
18  */
19 #define	PRINT_SWI_INFO		0
20 #define	PRINT_SWI_ERROR		1
21 #define PRINT_SWI_HEX		1
22 
23 #define	PRINT_SWI_CON_IO	1
24 #define	PRINT_SWI_BLK_IO	1
25 
26 /*
27  * Print switch, set var rkflash_debug corresponding bit to 1 if needed.
28  * I - info
29  * IO - IO request about
30  */
31 #define	PRINT_BIT_CON_IO	BIT(0)
32 #define	PRINT_BIT_BLK_IO	BIT(4)
33 
34 __printf(1, 2) int rkflash_print_info(const char *fmt, ...);
35 __printf(1, 2) int rkflash_print_error(const char *fmt, ...);
36 void rkflash_print_hex(const char *s, const void *buf, int w, size_t len);
37 
38 __printf(1, 2) int rkflash_print_dio(const char *fmt, ...);
39 __printf(1, 2) int rkflash_print_bio(const char *fmt, ...);
40 
41 #endif
42 
43