aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/chipidea/debug.c')
-rw-r--r--drivers/usb/chipidea/debug.c61
1 files changed, 33 insertions, 28 deletions
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 36a7063a6cba..96d899aee473 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -18,7 +18,7 @@
18 */ 18 */
19static int ci_device_show(struct seq_file *s, void *data) 19static int ci_device_show(struct seq_file *s, void *data)
20{ 20{
21 struct ci13xxx *ci = s->private; 21 struct ci_hdrc *ci = s->private;
22 struct usb_gadget *gadget = &ci->gadget; 22 struct usb_gadget *gadget = &ci->gadget;
23 23
24 seq_printf(s, "speed = %d\n", gadget->speed); 24 seq_printf(s, "speed = %d\n", gadget->speed);
@@ -58,7 +58,7 @@ static const struct file_operations ci_device_fops = {
58 */ 58 */
59static int ci_port_test_show(struct seq_file *s, void *data) 59static int ci_port_test_show(struct seq_file *s, void *data)
60{ 60{
61 struct ci13xxx *ci = s->private; 61 struct ci_hdrc *ci = s->private;
62 unsigned long flags; 62 unsigned long flags;
63 unsigned mode; 63 unsigned mode;
64 64
@@ -78,7 +78,7 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,
78 size_t count, loff_t *ppos) 78 size_t count, loff_t *ppos)
79{ 79{
80 struct seq_file *s = file->private_data; 80 struct seq_file *s = file->private_data;
81 struct ci13xxx *ci = s->private; 81 struct ci_hdrc *ci = s->private;
82 unsigned long flags; 82 unsigned long flags;
83 unsigned mode; 83 unsigned mode;
84 char buf[32]; 84 char buf[32];
@@ -115,7 +115,7 @@ static const struct file_operations ci_port_test_fops = {
115 */ 115 */
116static int ci_qheads_show(struct seq_file *s, void *data) 116static int ci_qheads_show(struct seq_file *s, void *data)
117{ 117{
118 struct ci13xxx *ci = s->private; 118 struct ci_hdrc *ci = s->private;
119 unsigned long flags; 119 unsigned long flags;
120 unsigned i, j; 120 unsigned i, j;
121 121
@@ -126,15 +126,15 @@ static int ci_qheads_show(struct seq_file *s, void *data)
126 126
127 spin_lock_irqsave(&ci->lock, flags); 127 spin_lock_irqsave(&ci->lock, flags);
128 for (i = 0; i < ci->hw_ep_max/2; i++) { 128 for (i = 0; i < ci->hw_ep_max/2; i++) {
129 struct ci13xxx_ep *mEpRx = &ci->ci13xxx_ep[i]; 129 struct ci_hw_ep *hweprx = &ci->ci_hw_ep[i];
130 struct ci13xxx_ep *mEpTx = 130 struct ci_hw_ep *hweptx =
131 &ci->ci13xxx_ep[i + ci->hw_ep_max/2]; 131 &ci->ci_hw_ep[i + ci->hw_ep_max/2];
132 seq_printf(s, "EP=%02i: RX=%08X TX=%08X\n", 132 seq_printf(s, "EP=%02i: RX=%08X TX=%08X\n",
133 i, (u32)mEpRx->qh.dma, (u32)mEpTx->qh.dma); 133 i, (u32)hweprx->qh.dma, (u32)hweptx->qh.dma);
134 for (j = 0; j < (sizeof(struct ci13xxx_qh)/sizeof(u32)); j++) 134 for (j = 0; j < (sizeof(struct ci_hw_qh)/sizeof(u32)); j++)
135 seq_printf(s, " %04X: %08X %08X\n", j, 135 seq_printf(s, " %04X: %08X %08X\n", j,
136 *((u32 *)mEpRx->qh.ptr + j), 136 *((u32 *)hweprx->qh.ptr + j),
137 *((u32 *)mEpTx->qh.ptr + j)); 137 *((u32 *)hweptx->qh.ptr + j));
138 } 138 }
139 spin_unlock_irqrestore(&ci->lock, flags); 139 spin_unlock_irqrestore(&ci->lock, flags);
140 140
@@ -158,11 +158,12 @@ static const struct file_operations ci_qheads_fops = {
158 */ 158 */
159static int ci_requests_show(struct seq_file *s, void *data) 159static int ci_requests_show(struct seq_file *s, void *data)
160{ 160{
161 struct ci13xxx *ci = s->private; 161 struct ci_hdrc *ci = s->private;
162 unsigned long flags; 162 unsigned long flags;
163 struct list_head *ptr = NULL; 163 struct list_head *ptr = NULL;
164 struct ci13xxx_req *req = NULL; 164 struct ci_hw_req *req = NULL;
165 unsigned i, j, qsize = sizeof(struct ci13xxx_td)/sizeof(u32); 165 struct td_node *node, *tmpnode;
166 unsigned i, j, qsize = sizeof(struct ci_hw_td)/sizeof(u32);
166 167
167 if (ci->role != CI_ROLE_GADGET) { 168 if (ci->role != CI_ROLE_GADGET) {
168 seq_printf(s, "not in gadget mode\n"); 169 seq_printf(s, "not in gadget mode\n");
@@ -171,16 +172,20 @@ static int ci_requests_show(struct seq_file *s, void *data)
171 172
172 spin_lock_irqsave(&ci->lock, flags); 173 spin_lock_irqsave(&ci->lock, flags);
173 for (i = 0; i < ci->hw_ep_max; i++) 174 for (i = 0; i < ci->hw_ep_max; i++)
174 list_for_each(ptr, &ci->ci13xxx_ep[i].qh.queue) { 175 list_for_each(ptr, &ci->ci_hw_ep[i].qh.queue) {
175 req = list_entry(ptr, struct ci13xxx_req, queue); 176 req = list_entry(ptr, struct ci_hw_req, queue);
176 177
177 seq_printf(s, "EP=%02i: TD=%08X %s\n", 178 list_for_each_entry_safe(node, tmpnode, &req->tds, td) {
178 i % (ci->hw_ep_max / 2), (u32)req->dma, 179 seq_printf(s, "EP=%02i: TD=%08X %s\n",
179 ((i < ci->hw_ep_max/2) ? "RX" : "TX")); 180 i % (ci->hw_ep_max / 2),
180 181 (u32)node->dma,
181 for (j = 0; j < qsize; j++) 182 ((i < ci->hw_ep_max/2) ?
182 seq_printf(s, " %04X: %08X\n", j, 183 "RX" : "TX"));
183 *((u32 *)req->ptr + j)); 184
185 for (j = 0; j < qsize; j++)
186 seq_printf(s, " %04X: %08X\n", j,
187 *((u32 *)node->ptr + j));
188 }
184 } 189 }
185 spin_unlock_irqrestore(&ci->lock, flags); 190 spin_unlock_irqrestore(&ci->lock, flags);
186 191
@@ -201,7 +206,7 @@ static const struct file_operations ci_requests_fops = {
201 206
202static int ci_role_show(struct seq_file *s, void *data) 207static int ci_role_show(struct seq_file *s, void *data)
203{ 208{
204 struct ci13xxx *ci = s->private; 209 struct ci_hdrc *ci = s->private;
205 210
206 seq_printf(s, "%s\n", ci_role(ci)->name); 211 seq_printf(s, "%s\n", ci_role(ci)->name);
207 212
@@ -212,7 +217,7 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf,
212 size_t count, loff_t *ppos) 217 size_t count, loff_t *ppos)
213{ 218{
214 struct seq_file *s = file->private_data; 219 struct seq_file *s = file->private_data;
215 struct ci13xxx *ci = s->private; 220 struct ci_hdrc *ci = s->private;
216 enum ci_role role; 221 enum ci_role role;
217 char buf[8]; 222 char buf[8];
218 int ret; 223 int ret;
@@ -254,7 +259,7 @@ static const struct file_operations ci_role_fops = {
254 * 259 *
255 * This function returns an error code 260 * This function returns an error code
256 */ 261 */
257int dbg_create_files(struct ci13xxx *ci) 262int dbg_create_files(struct ci_hdrc *ci)
258{ 263{
259 struct dentry *dent; 264 struct dentry *dent;
260 265
@@ -295,7 +300,7 @@ err:
295 * dbg_remove_files: destroys the attribute interface 300 * dbg_remove_files: destroys the attribute interface
296 * @ci: device 301 * @ci: device
297 */ 302 */
298void dbg_remove_files(struct ci13xxx *ci) 303void dbg_remove_files(struct ci_hdrc *ci)
299{ 304{
300 debugfs_remove_recursive(ci->debugfs); 305 debugfs_remove_recursive(ci->debugfs);
301} 306}