• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * drivers/usb/sunxi_usb/udc/sunxi_udc_debug.c
3  * (C) Copyright 2010-2015
4  * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
5  * javen, 2010-3-3, create this file
6  *
7  * usb udc debug.
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 #include <linux/module.h>
17 #include <linux/kernel.h>
18 #include <linux/delay.h>
19 #include <linux/ioport.h>
20 #include <linux/sched.h>
21 #include <linux/slab.h>
22 #include <linux/errno.h>
23 #include <linux/init.h>
24 #include <linux/timer.h>
25 #include <linux/list.h>
26 #include <linux/interrupt.h>
27 #include <linux/platform_device.h>
28 #include <linux/clk.h>
29 
30 #include <linux/debugfs.h>
31 #include <linux/seq_file.h>
32 
33 #include  "sunxi_udc_config.h"
34 #include  "sunxi_udc_board.h"
35 #include  "sunxi_udc_debug.h"
36 
print_list_node(struct sunxi_udc_ep * ep,char * str)37 void print_list_node(struct sunxi_udc_ep *ep, char *str)
38 {
39 #ifdef SW_UDC_DEBUG
40 	struct sunxi_udc_request	*req = NULL;
41 	spinlock_t lock;
42 	unsigned long flags = 0;
43 
44 	spin_lock_init(&lock);
45 	spin_lock_irqsave(&lock, flags);
46 
47 	DMSG_INFO("---------------ep%d: %s-------------\n", ep->num, str);
48 	list_for_each_entry(req, &ep->queue, queue) {
49 		DMSG_INFO("print_list_node: ep(0x%p, %d), req(0x%p, 0x%p, %d, %d)\n\n",
50 			ep, ep->num, req, &(req->req),
51 			req->req.length, req->req.actual);
52 	}
53 	DMSG_INFO("-------------------------------------\n");
54 
55 	spin_unlock_irqrestore(&lock, flags);
56 
57 	return;
58 #endif
59 }
60 
61