aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/davinci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/davinci.c')
-rw-r--r--drivers/usb/musb/davinci.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 7c569f51212a..97ab975fa442 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -265,6 +265,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
265 unsigned long flags; 265 unsigned long flags;
266 irqreturn_t retval = IRQ_NONE; 266 irqreturn_t retval = IRQ_NONE;
267 struct musb *musb = __hci; 267 struct musb *musb = __hci;
268 struct usb_otg *otg = musb->xceiv->otg;
268 void __iomem *tibase = musb->ctrl_base; 269 void __iomem *tibase = musb->ctrl_base;
269 struct cppi *cppi; 270 struct cppi *cppi;
270 u32 tmp; 271 u32 tmp;
@@ -331,14 +332,14 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
331 WARNING("VBUS error workaround (delay coming)\n"); 332 WARNING("VBUS error workaround (delay coming)\n");
332 } else if (is_host_enabled(musb) && drvvbus) { 333 } else if (is_host_enabled(musb) && drvvbus) {
333 MUSB_HST_MODE(musb); 334 MUSB_HST_MODE(musb);
334 musb->xceiv->default_a = 1; 335 otg->default_a = 1;
335 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 336 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
336 portstate(musb->port1_status |= USB_PORT_STAT_POWER); 337 portstate(musb->port1_status |= USB_PORT_STAT_POWER);
337 del_timer(&otg_workaround); 338 del_timer(&otg_workaround);
338 } else { 339 } else {
339 musb->is_active = 0; 340 musb->is_active = 0;
340 MUSB_DEV_MODE(musb); 341 MUSB_DEV_MODE(musb);
341 musb->xceiv->default_a = 0; 342 otg->default_a = 0;
342 musb->xceiv->state = OTG_STATE_B_IDLE; 343 musb->xceiv->state = OTG_STATE_B_IDLE;
343 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); 344 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
344 } 345 }
@@ -383,7 +384,7 @@ static int davinci_musb_init(struct musb *musb)
383 u32 revision; 384 u32 revision;
384 385
385 usb_nop_xceiv_register(); 386 usb_nop_xceiv_register();
386 musb->xceiv = otg_get_transceiver(); 387 musb->xceiv = usb_get_transceiver();
387 if (!musb->xceiv) 388 if (!musb->xceiv)
388 return -ENODEV; 389 return -ENODEV;
389 390
@@ -442,7 +443,7 @@ static int davinci_musb_init(struct musb *musb)
442 return 0; 443 return 0;
443 444
444fail: 445fail:
445 otg_put_transceiver(musb->xceiv); 446 usb_put_transceiver(musb->xceiv);
446 usb_nop_xceiv_unregister(); 447 usb_nop_xceiv_unregister();
447 return -ENODEV; 448 return -ENODEV;
448} 449}
@@ -464,7 +465,7 @@ static int davinci_musb_exit(struct musb *musb)
464 davinci_musb_source_power(musb, 0 /*off*/, 1); 465 davinci_musb_source_power(musb, 0 /*off*/, 1);
465 466
466 /* delay, to avoid problems with module reload */ 467 /* delay, to avoid problems with module reload */
467 if (is_host_enabled(musb) && musb->xceiv->default_a) { 468 if (is_host_enabled(musb) && musb->xceiv->otg->default_a) {
468 int maxdelay = 30; 469 int maxdelay = 30;
469 u8 devctl, warn = 0; 470 u8 devctl, warn = 0;
470 471
@@ -491,7 +492,7 @@ static int davinci_musb_exit(struct musb *musb)
491 492
492 phy_off(); 493 phy_off();
493 494
494 otg_put_transceiver(musb->xceiv); 495 usb_put_transceiver(musb->xceiv);
495 usb_nop_xceiv_unregister(); 496 usb_nop_xceiv_unregister();
496 497
497 return 0; 498 return 0;
@@ -511,7 +512,7 @@ static const struct musb_platform_ops davinci_ops = {
511 512
512static u64 davinci_dmamask = DMA_BIT_MASK(32); 513static u64 davinci_dmamask = DMA_BIT_MASK(32);
513 514
514static int __init davinci_probe(struct platform_device *pdev) 515static int __devinit davinci_probe(struct platform_device *pdev)
515{ 516{
516 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 517 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
517 struct platform_device *musb; 518 struct platform_device *musb;
@@ -594,7 +595,7 @@ err0:
594 return ret; 595 return ret;
595} 596}
596 597
597static int __exit davinci_remove(struct platform_device *pdev) 598static int __devexit davinci_remove(struct platform_device *pdev)
598{ 599{
599 struct davinci_glue *glue = platform_get_drvdata(pdev); 600 struct davinci_glue *glue = platform_get_drvdata(pdev);
600 601
@@ -608,7 +609,8 @@ static int __exit davinci_remove(struct platform_device *pdev)
608} 609}
609 610
610static struct platform_driver davinci_driver = { 611static struct platform_driver davinci_driver = {
611 .remove = __exit_p(davinci_remove), 612 .probe = davinci_probe,
613 .remove = __devexit_p(davinci_remove),
612 .driver = { 614 .driver = {
613 .name = "musb-davinci", 615 .name = "musb-davinci",
614 }, 616 },
@@ -620,9 +622,9 @@ MODULE_LICENSE("GPL v2");
620 622
621static int __init davinci_init(void) 623static int __init davinci_init(void)
622{ 624{
623 return platform_driver_probe(&davinci_driver, davinci_probe); 625 return platform_driver_register(&davinci_driver);
624} 626}
625subsys_initcall(davinci_init); 627module_init(davinci_init);
626 628
627static void __exit davinci_exit(void) 629static void __exit davinci_exit(void)
628{ 630{