diff options
Diffstat (limited to 'drivers/usb/gadget/m66592-udc.c')
-rw-r--r-- | drivers/usb/gadget/m66592-udc.c | 104 |
1 files changed, 79 insertions, 25 deletions
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index ebc5536aa271..835948f0715a 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -36,9 +36,14 @@ MODULE_DESCRIPTION("M66592 USB gadget driver"); | |||
36 | MODULE_LICENSE("GPL"); | 36 | MODULE_LICENSE("GPL"); |
37 | MODULE_AUTHOR("Yoshihiro Shimoda"); | 37 | MODULE_AUTHOR("Yoshihiro Shimoda"); |
38 | 38 | ||
39 | #define DRIVER_VERSION "29 May 2007" | 39 | #define DRIVER_VERSION "18 Oct 2007" |
40 | 40 | ||
41 | /* module parameters */ | 41 | /* module parameters */ |
42 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
43 | static unsigned short endian = M66592_LITTLE; | ||
44 | module_param(endian, ushort, 0644); | ||
45 | MODULE_PARM_DESC(endian, "data endian: big=0, little=0 (default=0)"); | ||
46 | #else | ||
42 | static unsigned short clock = M66592_XTAL24; | 47 | static unsigned short clock = M66592_XTAL24; |
43 | module_param(clock, ushort, 0644); | 48 | module_param(clock, ushort, 0644); |
44 | MODULE_PARM_DESC(clock, "input clock: 48MHz=32768, 24MHz=16384, 12MHz=0 " | 49 | MODULE_PARM_DESC(clock, "input clock: 48MHz=32768, 24MHz=16384, 12MHz=0 " |
@@ -56,6 +61,7 @@ static unsigned short irq_sense = M66592_INTL; | |||
56 | module_param(irq_sense, ushort, 0644); | 61 | module_param(irq_sense, ushort, 0644); |
57 | MODULE_PARM_DESC(irq_sense, "IRQ sense: low level=2, falling edge=0 " | 62 | MODULE_PARM_DESC(irq_sense, "IRQ sense: low level=2, falling edge=0 " |
58 | "(default=2)"); | 63 | "(default=2)"); |
64 | #endif | ||
59 | 65 | ||
60 | static const char udc_name[] = "m66592_udc"; | 66 | static const char udc_name[] = "m66592_udc"; |
61 | static const char *m66592_ep_name[] = { | 67 | static const char *m66592_ep_name[] = { |
@@ -141,7 +147,7 @@ static inline u16 control_reg_get_pid(struct m66592 *m66592, u16 pipenum) | |||
141 | offset = get_pipectr_addr(pipenum); | 147 | offset = get_pipectr_addr(pipenum); |
142 | pid = m66592_read(m66592, offset) & M66592_PID; | 148 | pid = m66592_read(m66592, offset) & M66592_PID; |
143 | } else | 149 | } else |
144 | printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); | 150 | pr_err("unexpect pipe num (%d)\n", pipenum); |
145 | 151 | ||
146 | return pid; | 152 | return pid; |
147 | } | 153 | } |
@@ -157,7 +163,7 @@ static inline void control_reg_set_pid(struct m66592 *m66592, u16 pipenum, | |||
157 | offset = get_pipectr_addr(pipenum); | 163 | offset = get_pipectr_addr(pipenum); |
158 | m66592_mdfy(m66592, pid, M66592_PID, offset); | 164 | m66592_mdfy(m66592, pid, M66592_PID, offset); |
159 | } else | 165 | } else |
160 | printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); | 166 | pr_err("unexpect pipe num (%d)\n", pipenum); |
161 | } | 167 | } |
162 | 168 | ||
163 | static inline void pipe_start(struct m66592 *m66592, u16 pipenum) | 169 | static inline void pipe_start(struct m66592 *m66592, u16 pipenum) |
@@ -186,7 +192,7 @@ static inline u16 control_reg_get(struct m66592 *m66592, u16 pipenum) | |||
186 | offset = get_pipectr_addr(pipenum); | 192 | offset = get_pipectr_addr(pipenum); |
187 | ret = m66592_read(m66592, offset); | 193 | ret = m66592_read(m66592, offset); |
188 | } else | 194 | } else |
189 | printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); | 195 | pr_err("unexpect pipe num (%d)\n", pipenum); |
190 | 196 | ||
191 | return ret; | 197 | return ret; |
192 | } | 198 | } |
@@ -203,7 +209,7 @@ static inline void control_reg_sqclr(struct m66592 *m66592, u16 pipenum) | |||
203 | offset = get_pipectr_addr(pipenum); | 209 | offset = get_pipectr_addr(pipenum); |
204 | m66592_bset(m66592, M66592_SQCLR, offset); | 210 | m66592_bset(m66592, M66592_SQCLR, offset); |
205 | } else | 211 | } else |
206 | printk(KERN_ERR "unexpect pipe num(%d)\n", pipenum); | 212 | pr_err("unexpect pipe num(%d)\n", pipenum); |
207 | } | 213 | } |
208 | 214 | ||
209 | static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) | 215 | static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) |
@@ -285,7 +291,7 @@ static int pipe_buffer_setting(struct m66592 *m66592, | |||
285 | break; | 291 | break; |
286 | } | 292 | } |
287 | if (m66592->bi_bufnum > M66592_MAX_BUFNUM) { | 293 | if (m66592->bi_bufnum > M66592_MAX_BUFNUM) { |
288 | printk(KERN_ERR "m66592 pipe memory is insufficient(%d)\n", | 294 | pr_err("m66592 pipe memory is insufficient(%d)\n", |
289 | m66592->bi_bufnum); | 295 | m66592->bi_bufnum); |
290 | return -ENOMEM; | 296 | return -ENOMEM; |
291 | } | 297 | } |
@@ -326,7 +332,7 @@ static void pipe_buffer_release(struct m66592 *m66592, | |||
326 | if (info->type == M66592_BULK) | 332 | if (info->type == M66592_BULK) |
327 | m66592->bulk--; | 333 | m66592->bulk--; |
328 | } else | 334 | } else |
329 | printk(KERN_ERR "ep_release: unexpect pipenum (%d)\n", | 335 | pr_err("ep_release: unexpect pipenum (%d)\n", |
330 | info->pipe); | 336 | info->pipe); |
331 | } | 337 | } |
332 | 338 | ||
@@ -360,6 +366,7 @@ static void m66592_ep_setting(struct m66592 *m66592, struct m66592_ep *ep, | |||
360 | ep->fifosel = M66592_D0FIFOSEL; | 366 | ep->fifosel = M66592_D0FIFOSEL; |
361 | ep->fifoctr = M66592_D0FIFOCTR; | 367 | ep->fifoctr = M66592_D0FIFOCTR; |
362 | ep->fifotrn = M66592_D0FIFOTRN; | 368 | ep->fifotrn = M66592_D0FIFOTRN; |
369 | #if !defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
363 | } else if (m66592->num_dma == 1) { | 370 | } else if (m66592->num_dma == 1) { |
364 | m66592->num_dma++; | 371 | m66592->num_dma++; |
365 | ep->use_dma = 1; | 372 | ep->use_dma = 1; |
@@ -367,6 +374,7 @@ static void m66592_ep_setting(struct m66592 *m66592, struct m66592_ep *ep, | |||
367 | ep->fifosel = M66592_D1FIFOSEL; | 374 | ep->fifosel = M66592_D1FIFOSEL; |
368 | ep->fifoctr = M66592_D1FIFOCTR; | 375 | ep->fifoctr = M66592_D1FIFOCTR; |
369 | ep->fifotrn = M66592_D1FIFOTRN; | 376 | ep->fifotrn = M66592_D1FIFOTRN; |
377 | #endif | ||
370 | } else { | 378 | } else { |
371 | ep->use_dma = 0; | 379 | ep->use_dma = 0; |
372 | ep->fifoaddr = M66592_CFIFO; | 380 | ep->fifoaddr = M66592_CFIFO; |
@@ -422,7 +430,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
422 | case USB_ENDPOINT_XFER_BULK: | 430 | case USB_ENDPOINT_XFER_BULK: |
423 | if (m66592->bulk >= M66592_MAX_NUM_BULK) { | 431 | if (m66592->bulk >= M66592_MAX_NUM_BULK) { |
424 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { | 432 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { |
425 | printk(KERN_ERR "bulk pipe is insufficient\n"); | 433 | pr_err("bulk pipe is insufficient\n"); |
426 | return -ENODEV; | 434 | return -ENODEV; |
427 | } else { | 435 | } else { |
428 | info.pipe = M66592_BASE_PIPENUM_ISOC | 436 | info.pipe = M66592_BASE_PIPENUM_ISOC |
@@ -438,7 +446,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
438 | break; | 446 | break; |
439 | case USB_ENDPOINT_XFER_INT: | 447 | case USB_ENDPOINT_XFER_INT: |
440 | if (m66592->interrupt >= M66592_MAX_NUM_INT) { | 448 | if (m66592->interrupt >= M66592_MAX_NUM_INT) { |
441 | printk(KERN_ERR "interrupt pipe is insufficient\n"); | 449 | pr_err("interrupt pipe is insufficient\n"); |
442 | return -ENODEV; | 450 | return -ENODEV; |
443 | } | 451 | } |
444 | info.pipe = M66592_BASE_PIPENUM_INT + m66592->interrupt; | 452 | info.pipe = M66592_BASE_PIPENUM_INT + m66592->interrupt; |
@@ -447,7 +455,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
447 | break; | 455 | break; |
448 | case USB_ENDPOINT_XFER_ISOC: | 456 | case USB_ENDPOINT_XFER_ISOC: |
449 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { | 457 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { |
450 | printk(KERN_ERR "isochronous pipe is insufficient\n"); | 458 | pr_err("isochronous pipe is insufficient\n"); |
451 | return -ENODEV; | 459 | return -ENODEV; |
452 | } | 460 | } |
453 | info.pipe = M66592_BASE_PIPENUM_ISOC + m66592->isochronous; | 461 | info.pipe = M66592_BASE_PIPENUM_ISOC + m66592->isochronous; |
@@ -455,7 +463,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
455 | counter = &m66592->isochronous; | 463 | counter = &m66592->isochronous; |
456 | break; | 464 | break; |
457 | default: | 465 | default: |
458 | printk(KERN_ERR "unexpect xfer type\n"); | 466 | pr_err("unexpect xfer type\n"); |
459 | return -EINVAL; | 467 | return -EINVAL; |
460 | } | 468 | } |
461 | ep->type = info.type; | 469 | ep->type = info.type; |
@@ -470,7 +478,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
470 | 478 | ||
471 | ret = pipe_buffer_setting(m66592, &info); | 479 | ret = pipe_buffer_setting(m66592, &info); |
472 | if (ret < 0) { | 480 | if (ret < 0) { |
473 | printk(KERN_ERR "pipe_buffer_setting fail\n"); | 481 | pr_err("pipe_buffer_setting fail\n"); |
474 | return ret; | 482 | return ret; |
475 | } | 483 | } |
476 | 484 | ||
@@ -606,11 +614,33 @@ static void start_ep0(struct m66592_ep *ep, struct m66592_request *req) | |||
606 | control_end(ep->m66592, 0); | 614 | control_end(ep->m66592, 0); |
607 | break; | 615 | break; |
608 | default: | 616 | default: |
609 | printk(KERN_ERR "start_ep0: unexpect ctsq(%x)\n", ctsq); | 617 | pr_err("start_ep0: unexpect ctsq(%x)\n", ctsq); |
610 | break; | 618 | break; |
611 | } | 619 | } |
612 | } | 620 | } |
613 | 621 | ||
622 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
623 | static void init_controller(struct m66592 *m66592) | ||
624 | { | ||
625 | usbf_start_clock(); | ||
626 | m66592_bset(m66592, M66592_HSE, M66592_SYSCFG); /* High spd */ | ||
627 | m66592_bclr(m66592, M66592_USBE, M66592_SYSCFG); | ||
628 | m66592_bclr(m66592, M66592_DPRPU, M66592_SYSCFG); | ||
629 | m66592_bset(m66592, M66592_USBE, M66592_SYSCFG); | ||
630 | |||
631 | /* This is a workaound for SH7722 2nd cut */ | ||
632 | m66592_bset(m66592, 0x8000, M66592_DVSTCTR); | ||
633 | m66592_bset(m66592, 0x1000, M66592_TESTMODE); | ||
634 | m66592_bclr(m66592, 0x8000, M66592_DVSTCTR); | ||
635 | |||
636 | m66592_bset(m66592, M66592_INTL, M66592_INTENB1); | ||
637 | |||
638 | m66592_write(m66592, 0, M66592_CFBCFG); | ||
639 | m66592_write(m66592, 0, M66592_D0FBCFG); | ||
640 | m66592_bset(m66592, endian, M66592_CFBCFG); | ||
641 | m66592_bset(m66592, endian, M66592_D0FBCFG); | ||
642 | } | ||
643 | #else /* #if defined(CONFIG_SUPERH_BUILT_IN_M66592) */ | ||
614 | static void init_controller(struct m66592 *m66592) | 644 | static void init_controller(struct m66592 *m66592) |
615 | { | 645 | { |
616 | m66592_bset(m66592, (vif & M66592_LDRV) | (endian & M66592_BIGEND), | 646 | m66592_bset(m66592, (vif & M66592_LDRV) | (endian & M66592_BIGEND), |
@@ -636,9 +666,13 @@ static void init_controller(struct m66592 *m66592) | |||
636 | m66592_write(m66592, M66592_BURST | M66592_CPU_ADR_RD_WR, | 666 | m66592_write(m66592, M66592_BURST | M66592_CPU_ADR_RD_WR, |
637 | M66592_DMA0CFG); | 667 | M66592_DMA0CFG); |
638 | } | 668 | } |
669 | #endif /* #if defined(CONFIG_SUPERH_BUILT_IN_M66592) */ | ||
639 | 670 | ||
640 | static void disable_controller(struct m66592 *m66592) | 671 | static void disable_controller(struct m66592 *m66592) |
641 | { | 672 | { |
673 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
674 | usbf_stop_clock(); | ||
675 | #else | ||
642 | m66592_bclr(m66592, M66592_SCKE, M66592_SYSCFG); | 676 | m66592_bclr(m66592, M66592_SCKE, M66592_SYSCFG); |
643 | udelay(1); | 677 | udelay(1); |
644 | m66592_bclr(m66592, M66592_PLLC, M66592_SYSCFG); | 678 | m66592_bclr(m66592, M66592_PLLC, M66592_SYSCFG); |
@@ -646,15 +680,20 @@ static void disable_controller(struct m66592 *m66592) | |||
646 | m66592_bclr(m66592, M66592_RCKE, M66592_SYSCFG); | 680 | m66592_bclr(m66592, M66592_RCKE, M66592_SYSCFG); |
647 | udelay(1); | 681 | udelay(1); |
648 | m66592_bclr(m66592, M66592_XCKE, M66592_SYSCFG); | 682 | m66592_bclr(m66592, M66592_XCKE, M66592_SYSCFG); |
683 | #endif | ||
649 | } | 684 | } |
650 | 685 | ||
651 | static void m66592_start_xclock(struct m66592 *m66592) | 686 | static void m66592_start_xclock(struct m66592 *m66592) |
652 | { | 687 | { |
688 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
689 | usbf_start_clock(); | ||
690 | #else | ||
653 | u16 tmp; | 691 | u16 tmp; |
654 | 692 | ||
655 | tmp = m66592_read(m66592, M66592_SYSCFG); | 693 | tmp = m66592_read(m66592, M66592_SYSCFG); |
656 | if (!(tmp & M66592_XCKE)) | 694 | if (!(tmp & M66592_XCKE)) |
657 | m66592_bset(m66592, M66592_XCKE, M66592_SYSCFG); | 695 | m66592_bset(m66592, M66592_XCKE, M66592_SYSCFG); |
696 | #endif | ||
658 | } | 697 | } |
659 | 698 | ||
660 | /*-------------------------------------------------------------------------*/ | 699 | /*-------------------------------------------------------------------------*/ |
@@ -709,7 +748,7 @@ static void irq_ep0_write(struct m66592_ep *ep, struct m66592_request *req) | |||
709 | do { | 748 | do { |
710 | tmp = m66592_read(m66592, ep->fifoctr); | 749 | tmp = m66592_read(m66592, ep->fifoctr); |
711 | if (i++ > 100000) { | 750 | if (i++ > 100000) { |
712 | printk(KERN_ERR "pipe0 is busy. maybe cpu i/o bus" | 751 | pr_err("pipe0 is busy. maybe cpu i/o bus " |
713 | "conflict. please power off this controller."); | 752 | "conflict. please power off this controller."); |
714 | return; | 753 | return; |
715 | } | 754 | } |
@@ -759,7 +798,7 @@ static void irq_packet_write(struct m66592_ep *ep, struct m66592_request *req) | |||
759 | if (unlikely((tmp & M66592_FRDY) == 0)) { | 798 | if (unlikely((tmp & M66592_FRDY) == 0)) { |
760 | pipe_stop(m66592, pipenum); | 799 | pipe_stop(m66592, pipenum); |
761 | pipe_irq_disable(m66592, pipenum); | 800 | pipe_irq_disable(m66592, pipenum); |
762 | printk(KERN_ERR "write fifo not ready. pipnum=%d\n", pipenum); | 801 | pr_err("write fifo not ready. pipnum=%d\n", pipenum); |
763 | return; | 802 | return; |
764 | } | 803 | } |
765 | 804 | ||
@@ -808,7 +847,7 @@ static void irq_packet_read(struct m66592_ep *ep, struct m66592_request *req) | |||
808 | req->req.status = -EPIPE; | 847 | req->req.status = -EPIPE; |
809 | pipe_stop(m66592, pipenum); | 848 | pipe_stop(m66592, pipenum); |
810 | pipe_irq_disable(m66592, pipenum); | 849 | pipe_irq_disable(m66592, pipenum); |
811 | printk(KERN_ERR "read fifo not ready"); | 850 | pr_err("read fifo not ready"); |
812 | return; | 851 | return; |
813 | } | 852 | } |
814 | 853 | ||
@@ -1063,7 +1102,7 @@ static void m66592_update_usb_speed(struct m66592 *m66592) | |||
1063 | break; | 1102 | break; |
1064 | default: | 1103 | default: |
1065 | m66592->gadget.speed = USB_SPEED_UNKNOWN; | 1104 | m66592->gadget.speed = USB_SPEED_UNKNOWN; |
1066 | printk(KERN_ERR "USB speed unknown\n"); | 1105 | pr_err("USB speed unknown\n"); |
1067 | } | 1106 | } |
1068 | } | 1107 | } |
1069 | 1108 | ||
@@ -1122,7 +1161,7 @@ __acquires(m66592->lock) | |||
1122 | control_end(m66592, 0); | 1161 | control_end(m66592, 0); |
1123 | break; | 1162 | break; |
1124 | default: | 1163 | default: |
1125 | printk(KERN_ERR "ctrl_stage: unexpect ctsq(%x)\n", ctsq); | 1164 | pr_err("ctrl_stage: unexpect ctsq(%x)\n", ctsq); |
1126 | break; | 1165 | break; |
1127 | } | 1166 | } |
1128 | } | 1167 | } |
@@ -1142,6 +1181,19 @@ static irqreturn_t m66592_irq(int irq, void *_m66592) | |||
1142 | intsts0 = m66592_read(m66592, M66592_INTSTS0); | 1181 | intsts0 = m66592_read(m66592, M66592_INTSTS0); |
1143 | intenb0 = m66592_read(m66592, M66592_INTENB0); | 1182 | intenb0 = m66592_read(m66592, M66592_INTENB0); |
1144 | 1183 | ||
1184 | #if defined(CONFIG_SUPERH_BUILT_IN_M66592) | ||
1185 | if (!intsts0 && !intenb0) { | ||
1186 | /* | ||
1187 | * When USB clock stops, it cannot read register. Even if a | ||
1188 | * clock stops, the interrupt occurs. So this driver turn on | ||
1189 | * a clock by this timing and do re-reading of register. | ||
1190 | */ | ||
1191 | m66592_start_xclock(m66592); | ||
1192 | intsts0 = m66592_read(m66592, M66592_INTSTS0); | ||
1193 | intenb0 = m66592_read(m66592, M66592_INTENB0); | ||
1194 | } | ||
1195 | #endif | ||
1196 | |||
1145 | savepipe = m66592_read(m66592, M66592_CFIFOSEL); | 1197 | savepipe = m66592_read(m66592, M66592_CFIFOSEL); |
1146 | 1198 | ||
1147 | mask0 = intsts0 & intenb0; | 1199 | mask0 = intsts0 & intenb0; |
@@ -1409,13 +1461,13 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1409 | 1461 | ||
1410 | retval = device_add(&m66592->gadget.dev); | 1462 | retval = device_add(&m66592->gadget.dev); |
1411 | if (retval) { | 1463 | if (retval) { |
1412 | printk(KERN_ERR "device_add error (%d)\n", retval); | 1464 | pr_err("device_add error (%d)\n", retval); |
1413 | goto error; | 1465 | goto error; |
1414 | } | 1466 | } |
1415 | 1467 | ||
1416 | retval = driver->bind (&m66592->gadget); | 1468 | retval = driver->bind (&m66592->gadget); |
1417 | if (retval) { | 1469 | if (retval) { |
1418 | printk(KERN_ERR "bind to driver error (%d)\n", retval); | 1470 | pr_err("bind to driver error (%d)\n", retval); |
1419 | device_del(&m66592->gadget.dev); | 1471 | device_del(&m66592->gadget.dev); |
1420 | goto error; | 1472 | goto error; |
1421 | } | 1473 | } |
@@ -1456,6 +1508,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1456 | m66592_bclr(m66592, M66592_VBSE | M66592_URST, M66592_INTENB0); | 1508 | m66592_bclr(m66592, M66592_VBSE | M66592_URST, M66592_INTENB0); |
1457 | 1509 | ||
1458 | driver->unbind(&m66592->gadget); | 1510 | driver->unbind(&m66592->gadget); |
1511 | m66592->gadget.dev.driver = NULL; | ||
1459 | 1512 | ||
1460 | init_controller(m66592); | 1513 | init_controller(m66592); |
1461 | disable_controller(m66592); | 1514 | disable_controller(m66592); |
@@ -1485,6 +1538,7 @@ static int __exit m66592_remove(struct platform_device *pdev) | |||
1485 | iounmap(m66592->reg); | 1538 | iounmap(m66592->reg); |
1486 | free_irq(platform_get_irq(pdev, 0), m66592); | 1539 | free_irq(platform_get_irq(pdev, 0), m66592); |
1487 | m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req); | 1540 | m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req); |
1541 | usbf_stop_clock(); | ||
1488 | kfree(m66592); | 1542 | kfree(m66592); |
1489 | return 0; | 1543 | return 0; |
1490 | } | 1544 | } |
@@ -1508,28 +1562,28 @@ static int __init m66592_probe(struct platform_device *pdev) | |||
1508 | (char *)udc_name); | 1562 | (char *)udc_name); |
1509 | if (!res) { | 1563 | if (!res) { |
1510 | ret = -ENODEV; | 1564 | ret = -ENODEV; |
1511 | printk(KERN_ERR "platform_get_resource_byname error.\n"); | 1565 | pr_err("platform_get_resource_byname error.\n"); |
1512 | goto clean_up; | 1566 | goto clean_up; |
1513 | } | 1567 | } |
1514 | 1568 | ||
1515 | irq = platform_get_irq(pdev, 0); | 1569 | irq = platform_get_irq(pdev, 0); |
1516 | if (irq < 0) { | 1570 | if (irq < 0) { |
1517 | ret = -ENODEV; | 1571 | ret = -ENODEV; |
1518 | printk(KERN_ERR "platform_get_irq error.\n"); | 1572 | pr_err("platform_get_irq error.\n"); |
1519 | goto clean_up; | 1573 | goto clean_up; |
1520 | } | 1574 | } |
1521 | 1575 | ||
1522 | reg = ioremap(res->start, resource_len(res)); | 1576 | reg = ioremap(res->start, resource_len(res)); |
1523 | if (reg == NULL) { | 1577 | if (reg == NULL) { |
1524 | ret = -ENOMEM; | 1578 | ret = -ENOMEM; |
1525 | printk(KERN_ERR "ioremap error.\n"); | 1579 | pr_err("ioremap error.\n"); |
1526 | goto clean_up; | 1580 | goto clean_up; |
1527 | } | 1581 | } |
1528 | 1582 | ||
1529 | /* initialize ucd */ | 1583 | /* initialize ucd */ |
1530 | m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); | 1584 | m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); |
1531 | if (m66592 == NULL) { | 1585 | if (m66592 == NULL) { |
1532 | printk(KERN_ERR "kzalloc error\n"); | 1586 | pr_err("kzalloc error\n"); |
1533 | goto clean_up; | 1587 | goto clean_up; |
1534 | } | 1588 | } |
1535 | 1589 | ||
@@ -1555,7 +1609,7 @@ static int __init m66592_probe(struct platform_device *pdev) | |||
1555 | ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED, | 1609 | ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED, |
1556 | udc_name, m66592); | 1610 | udc_name, m66592); |
1557 | if (ret < 0) { | 1611 | if (ret < 0) { |
1558 | printk(KERN_ERR "request_irq error (%d)\n", ret); | 1612 | pr_err("request_irq error (%d)\n", ret); |
1559 | goto clean_up; | 1613 | goto clean_up; |
1560 | } | 1614 | } |
1561 | 1615 | ||