aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/imx_udc.h
diff options
context:
space:
mode:
authorDarius Augulis <augulis.darius@gmail.com>2009-01-21 08:17:55 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:28 -0400
commit593bef6c75e11d2edb5396bd9775cf49a4cda659 (patch)
tree1c67265b09667cb0fc1598f7ac3db1dc993b86b1 /drivers/usb/gadget/imx_udc.h
parent8f182e5ddc84a30d7014a753ae359d85b1238e7f (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/gadget/imx_udc.h')
-rw-r--r--drivers/usb/gadget/imx_udc.h46
1 files changed, 30 insertions, 16 deletions
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");