• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * drivers/usb/sunxi_usb/include/sunxi_usb_debug.h
3  * (C) Copyright 2010-2015
4  * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
5  * javen, 2010-12-20, create this file
6  *
7  * usb debug head file.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of
12  * the License, or (at your option) any later version.
13  *
14  */
15 
16 #ifndef __SUNXI_USB_DEBUG_H__
17 #define __SUNXI_USB_DEBUG_H__
18 
19 #if IS_ENABLED(CONFIG_USB_SUNXI_USB_DEBUG)
20 #define  DMSG_PRINT(stuff...)		printk(stuff)
21 #define  DMSG_PR(fmt, stuff...)	pr_debug(fmt, ##stuff)
22 #define  DMSG_INFO_UDC(fmt, ...)	DMSG_PR("[udc]: "fmt, ##__VA_ARGS__)
23 #define  DMSG_INFO_HCD0(fmt, ...)	DMSG_PR("[hcd0]: "fmt, ##__VA_ARGS__)
24 #define  DMSG_INFO_MANAGER(fmt, ...)	DMSG_PR("[magr]: "fmt, ##__VA_ARGS__)
25 #else
26 #define  DMSG_PRINT(stuff...)
27 #define  DMSG_PR(fmt, ...)
28 #define  DMSG_INFO_UDC(fmt, ...)
29 #define  DMSG_INFO_HCD0(fmt, ...)
30 #define  DMSG_INFO_MANAGER(fmt, ...)
31 #endif
32 
33 /* test */
34 #if 0
35 #define DMSG_TEST			DMSG_PRINT
36 #else
37 #define DMSG_TEST(...)
38 #endif
39 
40 /* code debug */
41 #if 0
42 #define DMSG_MANAGER_DEBUG		DMSG_PRINT
43 #else
44 #define DMSG_MANAGER_DEBUG(...)
45 #endif
46 
47 #if 0
48 #define DMSG_DEBUG			DMSG_PRINT
49 #else
50 #define DMSG_DEBUG(...)
51 #endif
52 
53 /* normal print */
54 #if 1
55 #define DMSG_INFO			DMSG_PRINT
56 #else
57 #define DMSG_INFO(...)
58 #endif
59 
60 /* serious warn */
61 #if 1
62 #define DMSG_PANIC			DMSG_PRINT
63 #else
64 #define DMSG_PANIC(...)
65 #endif
66 
67 /* normal warn */
68 #if 0
69 #define DMSG_WRN			DMSG_ERR
70 #else
71 #define DMSG_WRN(...)
72 #endif
73 
74 /* dma debug print */
75 #if	0
76 #define DMSG_DBG_DMA			DMSG_PRINT
77 #else
78 #define DMSG_DBG_DMA(...)
79 #endif
80 
81 void print_usb_reg_by_ep(spinlock_t *lock,
82 				void __iomem *usbc_base,
83 				__s32 ep_index,
84 				char *str);
85 void print_all_usb_reg(spinlock_t *lock,
86 				void __iomem *usbc_base,
87 				__s32 ep_start,
88 				__u32 ep_end,
89 				char *str);
90 
91 void clear_usb_reg(void __iomem *usb_base);
92 
93 #endif /* __SUNXI_USB_DEBUG_H__ */
94