diff options
author | Darius Augulis <augulis.darius@gmail.com> | 2009-01-21 08:17:55 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:20:28 -0400 |
commit | 593bef6c75e11d2edb5396bd9775cf49a4cda659 (patch) | |
tree | 1c67265b09667cb0fc1598f7ac3db1dc993b86b1 /drivers/usb | |
parent | 8f182e5ddc84a30d7014a753ae359d85b1238e7f (diff) |
USB: imx_udc: Fix IMX UDC gadget code style
Fix code style errors in IMX UDC Gadget.
Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/imx_udc.c | 59 | ||||
-rw-r--r-- | drivers/usb/gadget/imx_udc.h | 46 |
2 files changed, 69 insertions, 36 deletions
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index 9e3fe306301d..3ee5bd8bea70 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * driver/usb/gadget/imx_udc.c | 2 | * driver/usb/gadget/imx_udc.c |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Mike Lee(eemike@gmail.com) | 4 | * Copyright (C) 2005 Mike Lee <eemike@gmail.com> |
5 | * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com> | 5 | * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -51,7 +51,8 @@ void ep0_chg_stat(const char *label, struct imx_udc_struct *imx_usb, | |||
51 | void imx_udc_enable(struct imx_udc_struct *imx_usb) | 51 | void imx_udc_enable(struct imx_udc_struct *imx_usb) |
52 | { | 52 | { |
53 | int temp = __raw_readl(imx_usb->base + USB_CTRL); | 53 | int temp = __raw_readl(imx_usb->base + USB_CTRL); |
54 | __raw_writel(temp | CTRL_FE_ENA | CTRL_AFE_ENA, imx_usb->base + USB_CTRL); | 54 | __raw_writel(temp | CTRL_FE_ENA | CTRL_AFE_ENA, |
55 | imx_usb->base + USB_CTRL); | ||
55 | imx_usb->gadget.speed = USB_SPEED_FULL; | 56 | imx_usb->gadget.speed = USB_SPEED_FULL; |
56 | } | 57 | } |
57 | 58 | ||
@@ -126,7 +127,8 @@ void imx_udc_config(struct imx_udc_struct *imx_usb) | |||
126 | for (j = 0; j < 5; j++) { | 127 | for (j = 0; j < 5; j++) { |
127 | __raw_writeb(ep_conf[j], | 128 | __raw_writeb(ep_conf[j], |
128 | imx_usb->base + USB_DDAT); | 129 | imx_usb->base + USB_DDAT); |
129 | do {} while (__raw_readl(imx_usb->base + USB_DADR) | 130 | do {} while (__raw_readl(imx_usb->base |
131 | + USB_DADR) | ||
130 | & DADR_BSY); | 132 | & DADR_BSY); |
131 | } | 133 | } |
132 | } | 134 | } |
@@ -183,7 +185,8 @@ void imx_udc_init_ep(struct imx_udc_struct *imx_usb) | |||
183 | temp = (EP_DIR(imx_ep) << 7) | (max << 5) | 185 | temp = (EP_DIR(imx_ep) << 7) | (max << 5) |
184 | | (imx_ep->bmAttributes << 3); | 186 | | (imx_ep->bmAttributes << 3); |
185 | __raw_writel(temp, imx_usb->base + USB_EP_STAT(i)); | 187 | __raw_writel(temp, imx_usb->base + USB_EP_STAT(i)); |
186 | __raw_writel(temp | EPSTAT_FLUSH, imx_usb->base + USB_EP_STAT(i)); | 188 | __raw_writel(temp | EPSTAT_FLUSH, |
189 | imx_usb->base + USB_EP_STAT(i)); | ||
187 | D_INI(imx_usb->dev, "<%s> ep%d_stat %08x\n", __func__, i, | 190 | D_INI(imx_usb->dev, "<%s> ep%d_stat %08x\n", __func__, i, |
188 | __raw_readl(imx_usb->base + USB_EP_STAT(i))); | 191 | __raw_readl(imx_usb->base + USB_EP_STAT(i))); |
189 | } | 192 | } |
@@ -278,15 +281,18 @@ void imx_ep_stall(struct imx_ep_struct *imx_ep) | |||
278 | struct imx_udc_struct *imx_usb = imx_ep->imx_usb; | 281 | struct imx_udc_struct *imx_usb = imx_ep->imx_usb; |
279 | int temp, i; | 282 | int temp, i; |
280 | 283 | ||
281 | D_ERR(imx_usb->dev, "<%s> Forced stall on %s\n", __func__, imx_ep->ep.name); | 284 | D_ERR(imx_usb->dev, |
285 | "<%s> Forced stall on %s\n", __func__, imx_ep->ep.name); | ||
282 | 286 | ||
283 | imx_flush(imx_ep); | 287 | imx_flush(imx_ep); |
284 | 288 | ||
285 | /* Special care for ep0 */ | 289 | /* Special care for ep0 */ |
286 | if (!EP_NO(imx_ep)) { | 290 | if (!EP_NO(imx_ep)) { |
287 | temp = __raw_readl(imx_usb->base + USB_CTRL); | 291 | temp = __raw_readl(imx_usb->base + USB_CTRL); |
288 | __raw_writel(temp | CTRL_CMDOVER | CTRL_CMDERROR, imx_usb->base + USB_CTRL); | 292 | __raw_writel(temp | CTRL_CMDOVER | CTRL_CMDERROR, |
289 | do { } while (__raw_readl(imx_usb->base + USB_CTRL) & CTRL_CMDOVER); | 293 | imx_usb->base + USB_CTRL); |
294 | do { } while (__raw_readl(imx_usb->base + USB_CTRL) | ||
295 | & CTRL_CMDOVER); | ||
290 | temp = __raw_readl(imx_usb->base + USB_CTRL); | 296 | temp = __raw_readl(imx_usb->base + USB_CTRL); |
291 | __raw_writel(temp & ~CTRL_CMDERROR, imx_usb->base + USB_CTRL); | 297 | __raw_writel(temp & ~CTRL_CMDERROR, imx_usb->base + USB_CTRL); |
292 | } | 298 | } |
@@ -296,7 +302,8 @@ void imx_ep_stall(struct imx_ep_struct *imx_ep) | |||
296 | imx_usb->base + USB_EP_STAT(EP_NO(imx_ep))); | 302 | imx_usb->base + USB_EP_STAT(EP_NO(imx_ep))); |
297 | 303 | ||
298 | for (i = 0; i < 100; i ++) { | 304 | for (i = 0; i < 100; i ++) { |
299 | temp = __raw_readl(imx_usb->base + USB_EP_STAT(EP_NO(imx_ep))); | 305 | temp = __raw_readl(imx_usb->base |
306 | + USB_EP_STAT(EP_NO(imx_ep))); | ||
300 | if (!(temp & EPSTAT_STALL)) | 307 | if (!(temp & EPSTAT_STALL)) |
301 | break; | 308 | break; |
302 | udelay(20); | 309 | udelay(20); |
@@ -325,7 +332,8 @@ static int imx_udc_wakeup(struct usb_gadget *_gadget) | |||
325 | ******************************************************************************* | 332 | ******************************************************************************* |
326 | */ | 333 | */ |
327 | 334 | ||
328 | static void ep_add_request(struct imx_ep_struct *imx_ep, struct imx_request *req) | 335 | static void ep_add_request(struct imx_ep_struct *imx_ep, |
336 | struct imx_request *req) | ||
329 | { | 337 | { |
330 | if (unlikely(!req)) | 338 | if (unlikely(!req)) |
331 | return; | 339 | return; |
@@ -334,7 +342,8 @@ static void ep_add_request(struct imx_ep_struct *imx_ep, struct imx_request *req | |||
334 | list_add_tail(&req->queue, &imx_ep->queue); | 342 | list_add_tail(&req->queue, &imx_ep->queue); |
335 | } | 343 | } |
336 | 344 | ||
337 | static void ep_del_request(struct imx_ep_struct *imx_ep, struct imx_request *req) | 345 | static void ep_del_request(struct imx_ep_struct *imx_ep, |
346 | struct imx_request *req) | ||
338 | { | 347 | { |
339 | if (unlikely(!req)) | 348 | if (unlikely(!req)) |
340 | return; | 349 | return; |
@@ -343,7 +352,8 @@ static void ep_del_request(struct imx_ep_struct *imx_ep, struct imx_request *req | |||
343 | req->in_use = 0; | 352 | req->in_use = 0; |
344 | } | 353 | } |
345 | 354 | ||
346 | static void done(struct imx_ep_struct *imx_ep, struct imx_request *req, int status) | 355 | static void done(struct imx_ep_struct *imx_ep, |
356 | struct imx_request *req, int status) | ||
347 | { | 357 | { |
348 | ep_del_request(imx_ep, req); | 358 | ep_del_request(imx_ep, req); |
349 | 359 | ||
@@ -494,7 +504,8 @@ static int write_fifo(struct imx_ep_struct *imx_ep, struct imx_request *req) | |||
494 | __func__, imx_ep->ep.name, req, | 504 | __func__, imx_ep->ep.name, req, |
495 | completed ? "completed" : "not completed"); | 505 | completed ? "completed" : "not completed"); |
496 | if (!EP_NO(imx_ep)) | 506 | if (!EP_NO(imx_ep)) |
497 | ep0_chg_stat(__func__, imx_ep->imx_usb, EP0_IDLE); | 507 | ep0_chg_stat(__func__, |
508 | imx_ep->imx_usb, EP0_IDLE); | ||
498 | } | 509 | } |
499 | } | 510 | } |
500 | 511 | ||
@@ -586,7 +597,8 @@ static void handle_ep0_devreq(struct imx_udc_struct *imx_usb) | |||
586 | "<%s> no setup packet received\n", __func__); | 597 | "<%s> no setup packet received\n", __func__); |
587 | goto stall; | 598 | goto stall; |
588 | } | 599 | } |
589 | u.word[i] = __raw_readl(imx_usb->base + USB_EP_FDAT(EP_NO(imx_ep))); | 600 | u.word[i] = __raw_readl(imx_usb->base |
601 | + USB_EP_FDAT(EP_NO(imx_ep))); | ||
590 | } | 602 | } |
591 | 603 | ||
592 | temp = imx_ep_empty(imx_ep); | 604 | temp = imx_ep_empty(imx_ep); |
@@ -785,8 +797,10 @@ static int imx_ep_queue | |||
785 | /* Debug */ | 797 | /* Debug */ |
786 | D_REQ(imx_usb->dev, "<%s> ep%d %s request for [%d] bytes\n", | 798 | D_REQ(imx_usb->dev, "<%s> ep%d %s request for [%d] bytes\n", |
787 | __func__, EP_NO(imx_ep), | 799 | __func__, EP_NO(imx_ep), |
788 | ((!EP_NO(imx_ep) && imx_ep->imx_usb->ep0state == EP0_IN_DATA_PHASE) | 800 | ((!EP_NO(imx_ep) && imx_ep->imx_usb->ep0state |
789 | || (EP_NO(imx_ep) && EP_DIR(imx_ep))) ? "IN" : "OUT", usb_req->length); | 801 | == EP0_IN_DATA_PHASE) |
802 | || (EP_NO(imx_ep) && EP_DIR(imx_ep))) | ||
803 | ? "IN" : "OUT", usb_req->length); | ||
790 | dump_req(__func__, imx_ep, usb_req); | 804 | dump_req(__func__, imx_ep, usb_req); |
791 | 805 | ||
792 | if (imx_ep->stopped) { | 806 | if (imx_ep->stopped) { |
@@ -1061,7 +1075,8 @@ static irqreturn_t imx_udc_irq(int irq, void *dev) | |||
1061 | 1075 | ||
1062 | /* Config setup */ | 1076 | /* Config setup */ |
1063 | if (imx_usb->cfg != cfg) { | 1077 | if (imx_usb->cfg != cfg) { |
1064 | D_REQ(imx_usb->dev, "<%s> Change config start\n",__func__); | 1078 | D_REQ(imx_usb->dev, |
1079 | "<%s> Change config start\n", __func__); | ||
1065 | u.bRequest = USB_REQ_SET_CONFIGURATION; | 1080 | u.bRequest = USB_REQ_SET_CONFIGURATION; |
1066 | u.bRequestType = USB_DIR_OUT | | 1081 | u.bRequestType = USB_DIR_OUT | |
1067 | USB_TYPE_STANDARD | | 1082 | USB_TYPE_STANDARD | |
@@ -1073,11 +1088,13 @@ static irqreturn_t imx_udc_irq(int irq, void *dev) | |||
1073 | imx_usb->set_config = 1; | 1088 | imx_usb->set_config = 1; |
1074 | imx_usb->driver->setup(&imx_usb->gadget, &u); | 1089 | imx_usb->driver->setup(&imx_usb->gadget, &u); |
1075 | imx_usb->set_config = 0; | 1090 | imx_usb->set_config = 0; |
1076 | D_REQ(imx_usb->dev, "<%s> Change config done\n",__func__); | 1091 | D_REQ(imx_usb->dev, |
1092 | "<%s> Change config done\n", __func__); | ||
1077 | 1093 | ||
1078 | } | 1094 | } |
1079 | if (imx_usb->intf != intf || imx_usb->alt != alt) { | 1095 | if (imx_usb->intf != intf || imx_usb->alt != alt) { |
1080 | D_REQ(imx_usb->dev, "<%s> Change interface start\n",__func__); | 1096 | D_REQ(imx_usb->dev, |
1097 | "<%s> Change interface start\n", __func__); | ||
1081 | u.bRequest = USB_REQ_SET_INTERFACE; | 1098 | u.bRequest = USB_REQ_SET_INTERFACE; |
1082 | u.bRequestType = USB_DIR_OUT | | 1099 | u.bRequestType = USB_DIR_OUT | |
1083 | USB_TYPE_STANDARD | | 1100 | USB_TYPE_STANDARD | |
@@ -1090,7 +1107,8 @@ static irqreturn_t imx_udc_irq(int irq, void *dev) | |||
1090 | imx_usb->set_config = 1; | 1107 | imx_usb->set_config = 1; |
1091 | imx_usb->driver->setup(&imx_usb->gadget, &u); | 1108 | imx_usb->driver->setup(&imx_usb->gadget, &u); |
1092 | imx_usb->set_config = 0; | 1109 | imx_usb->set_config = 0; |
1093 | D_REQ(imx_usb->dev, "<%s> Change interface done\n",__func__); | 1110 | D_REQ(imx_usb->dev, |
1111 | "<%s> Change interface done\n", __func__); | ||
1094 | } | 1112 | } |
1095 | } | 1113 | } |
1096 | 1114 | ||
@@ -1102,7 +1120,8 @@ static irqreturn_t imx_udc_irq(int irq, void *dev) | |||
1102 | */ | 1120 | */ |
1103 | if (imx_usb->ep0state == EP0_IDLE) { | 1121 | if (imx_usb->ep0state == EP0_IDLE) { |
1104 | temp = __raw_readl(imx_usb->base + USB_CTRL); | 1122 | temp = __raw_readl(imx_usb->base + USB_CTRL); |
1105 | __raw_writel(temp | CTRL_CMDOVER, imx_usb->base + USB_CTRL); | 1123 | __raw_writel(temp | CTRL_CMDOVER, |
1124 | imx_usb->base + USB_CTRL); | ||
1106 | } | 1125 | } |
1107 | } | 1126 | } |
1108 | 1127 | ||
diff --git a/drivers/usb/gadget/imx_udc.h b/drivers/usb/gadget/imx_udc.h index d1dfb2d2fa8b..6b0b1e3d6fc7 100644 --- a/drivers/usb/gadget/imx_udc.h +++ b/drivers/usb/gadget/imx_udc.h | |||
@@ -23,7 +23,8 @@ | |||
23 | /* Helper macros */ | 23 | /* Helper macros */ |
24 | #define EP_NO(ep) ((ep->bEndpointAddress) & ~USB_DIR_IN) /* IN:1, OUT:0 */ | 24 | #define EP_NO(ep) ((ep->bEndpointAddress) & ~USB_DIR_IN) /* IN:1, OUT:0 */ |
25 | #define EP_DIR(ep) ((ep->bEndpointAddress) & USB_DIR_IN ? 1 : 0) | 25 | #define EP_DIR(ep) ((ep->bEndpointAddress) & USB_DIR_IN ? 1 : 0) |
26 | #define irq_to_ep(irq) (((irq) >= USBD_INT0) || ((irq) <= USBD_INT6) ? ((irq) - USBD_INT0) : (USBD_INT6)) /*should not happen*/ | 26 | #define irq_to_ep(irq) (((irq) >= USBD_INT0) || ((irq) <= USBD_INT6) \ |
27 | ? ((irq) - USBD_INT0) : (USBD_INT6)) /*should not happen*/ | ||
27 | #define ep_to_irq(ep) (EP_NO((ep)) + USBD_INT0) | 28 | #define ep_to_irq(ep) (EP_NO((ep)) + USBD_INT0) |
28 | #define IMX_USB_NB_EP 6 | 29 | #define IMX_USB_NB_EP 6 |
29 | 30 | ||
@@ -88,8 +89,8 @@ struct imx_udc_struct { | |||
88 | #define USB_EP_FDAT3(x) (0x3F + (x*0x30)) /* USB FIFO data */ | 89 | #define USB_EP_FDAT3(x) (0x3F + (x*0x30)) /* USB FIFO data */ |
89 | #define USB_EP_FSTAT(x) (0x40 + (x*0x30)) /* USB FIFO status */ | 90 | #define USB_EP_FSTAT(x) (0x40 + (x*0x30)) /* USB FIFO status */ |
90 | #define USB_EP_FCTRL(x) (0x44 + (x*0x30)) /* USB FIFO control */ | 91 | #define USB_EP_FCTRL(x) (0x44 + (x*0x30)) /* USB FIFO control */ |
91 | #define USB_EP_LRFP(x) (0x48 + (x*0x30)) /* USB last read frame pointer */ | 92 | #define USB_EP_LRFP(x) (0x48 + (x*0x30)) /* USB last rd f. pointer */ |
92 | #define USB_EP_LWFP(x) (0x4C + (x*0x30)) /* USB last write frame pointer */ | 93 | #define USB_EP_LWFP(x) (0x4C + (x*0x30)) /* USB last wr f. pointer */ |
93 | #define USB_EP_FALRM(x) (0x50 + (x*0x30)) /* USB FIFO alarm */ | 94 | #define USB_EP_FALRM(x) (0x50 + (x*0x30)) /* USB FIFO alarm */ |
94 | #define USB_EP_FRDP(x) (0x54 + (x*0x30)) /* USB FIFO read pointer */ | 95 | #define USB_EP_FRDP(x) (0x54 + (x*0x30)) /* USB FIFO read pointer */ |
95 | #define USB_EP_FWRP(x) (0x58 + (x*0x30)) /* USB FIFO write pointer */ | 96 | #define USB_EP_FWRP(x) (0x58 + (x*0x30)) /* USB FIFO write pointer */ |
@@ -228,7 +229,8 @@ struct imx_udc_struct { | |||
228 | #endif /* DEBUG_IRQ */ | 229 | #endif /* DEBUG_IRQ */ |
229 | 230 | ||
230 | #ifdef DEBUG_EPIRQ | 231 | #ifdef DEBUG_EPIRQ |
231 | static void dump_ep_intr(const char *label, int nr, int irqreg, struct device *dev) | 232 | static void dump_ep_intr(const char *label, int nr, int irqreg, |
233 | struct device *dev) | ||
232 | { | 234 | { |
233 | dev_dbg(dev, "<%s> EP%d_INTR=[%s%s%s%s%s%s%s%s%s]\n", label, nr, | 235 | dev_dbg(dev, "<%s> EP%d_INTR=[%s%s%s%s%s%s%s%s%s]\n", label, nr, |
234 | (irqreg & EPINTR_FIFO_FULL) ? " full" : "", | 236 | (irqreg & EPINTR_FIFO_FULL) ? " full" : "", |
@@ -246,7 +248,8 @@ struct imx_udc_struct { | |||
246 | #endif /* DEBUG_IRQ */ | 248 | #endif /* DEBUG_IRQ */ |
247 | 249 | ||
248 | #ifdef DEBUG_DUMP | 250 | #ifdef DEBUG_DUMP |
249 | static void dump_usb_stat(const char *label, struct imx_udc_struct *imx_usb) | 251 | static void dump_usb_stat(const char *label, |
252 | struct imx_udc_struct *imx_usb) | ||
250 | { | 253 | { |
251 | int temp = __raw_readl(imx_usb->base + USB_STAT); | 254 | int temp = __raw_readl(imx_usb->base + USB_STAT); |
252 | 255 | ||
@@ -259,12 +262,15 @@ struct imx_udc_struct { | |||
259 | (temp & STAT_ALTSET)); | 262 | (temp & STAT_ALTSET)); |
260 | } | 263 | } |
261 | 264 | ||
262 | static void dump_ep_stat(const char *label, struct imx_ep_struct *imx_ep) | 265 | static void dump_ep_stat(const char *label, |
266 | struct imx_ep_struct *imx_ep) | ||
263 | { | 267 | { |
264 | int temp = __raw_readl(imx_ep->imx_usb->base + USB_EP_INTR(EP_NO(imx_ep))); | 268 | int temp = __raw_readl(imx_ep->imx_usb->base |
269 | + USB_EP_INTR(EP_NO(imx_ep))); | ||
265 | 270 | ||
266 | dev_dbg(imx_ep->imx_usb->dev, | 271 | dev_dbg(imx_ep->imx_usb->dev, |
267 | "<%s> EP%d_INTR=[%s%s%s%s%s%s%s%s%s]\n", label, EP_NO(imx_ep), | 272 | "<%s> EP%d_INTR=[%s%s%s%s%s%s%s%s%s]\n", |
273 | label, EP_NO(imx_ep), | ||
268 | (temp & EPINTR_FIFO_FULL) ? " full" : "", | 274 | (temp & EPINTR_FIFO_FULL) ? " full" : "", |
269 | (temp & EPINTR_FIFO_EMPTY) ? " fempty" : "", | 275 | (temp & EPINTR_FIFO_EMPTY) ? " fempty" : "", |
270 | (temp & EPINTR_FIFO_ERROR) ? " ferr" : "", | 276 | (temp & EPINTR_FIFO_ERROR) ? " ferr" : "", |
@@ -275,18 +281,22 @@ struct imx_udc_struct { | |||
275 | (temp & EPINTR_DEVREQ) ? " devreq" : "", | 281 | (temp & EPINTR_DEVREQ) ? " devreq" : "", |
276 | (temp & EPINTR_EOT) ? " eot" : ""); | 282 | (temp & EPINTR_EOT) ? " eot" : ""); |
277 | 283 | ||
278 | temp = __raw_readl(imx_ep->imx_usb->base + USB_EP_STAT(EP_NO(imx_ep))); | 284 | temp = __raw_readl(imx_ep->imx_usb->base |
285 | + USB_EP_STAT(EP_NO(imx_ep))); | ||
279 | 286 | ||
280 | dev_dbg(imx_ep->imx_usb->dev, | 287 | dev_dbg(imx_ep->imx_usb->dev, |
281 | "<%s> EP%d_STAT=[%s%s bcount=%d]\n", label, EP_NO(imx_ep), | 288 | "<%s> EP%d_STAT=[%s%s bcount=%d]\n", |
289 | label, EP_NO(imx_ep), | ||
282 | (temp & EPSTAT_SIP) ? " sip" : "", | 290 | (temp & EPSTAT_SIP) ? " sip" : "", |
283 | (temp & EPSTAT_STALL) ? " stall" : "", | 291 | (temp & EPSTAT_STALL) ? " stall" : "", |
284 | (temp & EPSTAT_BCOUNT) >> 16); | 292 | (temp & EPSTAT_BCOUNT) >> 16); |
285 | 293 | ||
286 | temp = __raw_readl(imx_ep->imx_usb->base + USB_EP_FSTAT(EP_NO(imx_ep))); | 294 | temp = __raw_readl(imx_ep->imx_usb->base |
295 | + USB_EP_FSTAT(EP_NO(imx_ep))); | ||
287 | 296 | ||
288 | dev_dbg(imx_ep->imx_usb->dev, | 297 | dev_dbg(imx_ep->imx_usb->dev, |
289 | "<%s> EP%d_FSTAT=[%s%s%s%s%s%s%s]\n", label, EP_NO(imx_ep), | 298 | "<%s> EP%d_FSTAT=[%s%s%s%s%s%s%s]\n", |
299 | label, EP_NO(imx_ep), | ||
290 | (temp & FSTAT_ERR) ? " ferr" : "", | 300 | (temp & FSTAT_ERR) ? " ferr" : "", |
291 | (temp & FSTAT_UF) ? " funder" : "", | 301 | (temp & FSTAT_UF) ? " funder" : "", |
292 | (temp & FSTAT_OF) ? " fover" : "", | 302 | (temp & FSTAT_OF) ? " fover" : "", |
@@ -296,19 +306,23 @@ struct imx_udc_struct { | |||
296 | (temp & FSTAT_EMPTY) ? " fempty" : ""); | 306 | (temp & FSTAT_EMPTY) ? " fempty" : ""); |
297 | } | 307 | } |
298 | 308 | ||
299 | static void dump_req(const char *label, struct imx_ep_struct *imx_ep, struct usb_request *req) | 309 | static void dump_req(const char *label, struct imx_ep_struct *imx_ep, |
310 | struct usb_request *req) | ||
300 | { | 311 | { |
301 | int i; | 312 | int i; |
302 | 313 | ||
303 | if (!req || !req->buf) { | 314 | if (!req || !req->buf) { |
304 | dev_dbg(imx_ep->imx_usb->dev, "<%s> req or req buf is free\n", label); | 315 | dev_dbg(imx_ep->imx_usb->dev, |
316 | "<%s> req or req buf is free\n", label); | ||
305 | return; | 317 | return; |
306 | } | 318 | } |
307 | 319 | ||
308 | if ((!EP_NO(imx_ep) && imx_ep->imx_usb->ep0state == EP0_IN_DATA_PHASE) | 320 | if ((!EP_NO(imx_ep) && imx_ep->imx_usb->ep0state |
321 | == EP0_IN_DATA_PHASE) | ||
309 | || (EP_NO(imx_ep) && EP_DIR(imx_ep))) { | 322 | || (EP_NO(imx_ep) && EP_DIR(imx_ep))) { |
310 | 323 | ||
311 | dev_dbg(imx_ep->imx_usb->dev, "<%s> request dump <", label); | 324 | dev_dbg(imx_ep->imx_usb->dev, |
325 | "<%s> request dump <", label); | ||
312 | for (i = 0; i < req->length; i++) | 326 | for (i = 0; i < req->length; i++) |
313 | printk("%02x-", *((u8 *)req->buf + i)); | 327 | printk("%02x-", *((u8 *)req->buf + i)); |
314 | printk(">\n"); | 328 | printk(">\n"); |