aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/am35x.c20
-rw-r--r--drivers/usb/musb/blackfin.c15
-rw-r--r--drivers/usb/musb/da8xx.c20
-rw-r--r--drivers/usb/musb/davinci.c24
-rw-r--r--drivers/usb/musb/musb_core.c77
-rw-r--r--drivers/usb/musb/musb_core.h2
-rw-r--r--drivers/usb/musb/musb_debugfs.c14
-rw-r--r--drivers/usb/musb/musb_gadget.c39
-rw-r--r--drivers/usb/musb/musb_virthub.c9
-rw-r--r--drivers/usb/musb/omap2430.c46
-rw-r--r--drivers/usb/musb/tusb6010.c33
-rw-r--r--drivers/usb/musb/ux500.c19
12 files changed, 174 insertions, 144 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index e233d2b7d335..9f3eda91ea4d 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -226,6 +226,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
226 struct device *dev = musb->controller; 226 struct device *dev = musb->controller;
227 struct musb_hdrc_platform_data *plat = dev->platform_data; 227 struct musb_hdrc_platform_data *plat = dev->platform_data;
228 struct omap_musb_board_data *data = plat->board_data; 228 struct omap_musb_board_data *data = plat->board_data;
229 struct usb_otg *otg = musb->xceiv->otg;
229 unsigned long flags; 230 unsigned long flags;
230 irqreturn_t ret = IRQ_NONE; 231 irqreturn_t ret = IRQ_NONE;
231 u32 epintr, usbintr; 232 u32 epintr, usbintr;
@@ -289,14 +290,14 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
289 WARNING("VBUS error workaround (delay coming)\n"); 290 WARNING("VBUS error workaround (delay coming)\n");
290 } else if (is_host_enabled(musb) && drvvbus) { 291 } else if (is_host_enabled(musb) && drvvbus) {
291 MUSB_HST_MODE(musb); 292 MUSB_HST_MODE(musb);
292 musb->xceiv->default_a = 1; 293 otg->default_a = 1;
293 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 294 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
294 portstate(musb->port1_status |= USB_PORT_STAT_POWER); 295 portstate(musb->port1_status |= USB_PORT_STAT_POWER);
295 del_timer(&otg_workaround); 296 del_timer(&otg_workaround);
296 } else { 297 } else {
297 musb->is_active = 0; 298 musb->is_active = 0;
298 MUSB_DEV_MODE(musb); 299 MUSB_DEV_MODE(musb);
299 musb->xceiv->default_a = 0; 300 otg->default_a = 0;
300 musb->xceiv->state = OTG_STATE_B_IDLE; 301 musb->xceiv->state = OTG_STATE_B_IDLE;
301 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); 302 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
302 } 303 }
@@ -363,7 +364,7 @@ static int am35x_musb_init(struct musb *musb)
363 return -ENODEV; 364 return -ENODEV;
364 365
365 usb_nop_xceiv_register(); 366 usb_nop_xceiv_register();
366 musb->xceiv = otg_get_transceiver(); 367 musb->xceiv = usb_get_transceiver();
367 if (!musb->xceiv) 368 if (!musb->xceiv)
368 return -ENODEV; 369 return -ENODEV;
369 370
@@ -405,7 +406,7 @@ static int am35x_musb_exit(struct musb *musb)
405 if (data->set_phy_power) 406 if (data->set_phy_power)
406 data->set_phy_power(0); 407 data->set_phy_power(0);
407 408
408 otg_put_transceiver(musb->xceiv); 409 usb_put_transceiver(musb->xceiv);
409 usb_nop_xceiv_unregister(); 410 usb_nop_xceiv_unregister();
410 411
411 return 0; 412 return 0;
@@ -456,7 +457,7 @@ static const struct musb_platform_ops am35x_ops = {
456 457
457static u64 am35x_dmamask = DMA_BIT_MASK(32); 458static u64 am35x_dmamask = DMA_BIT_MASK(32);
458 459
459static int __init am35x_probe(struct platform_device *pdev) 460static int __devinit am35x_probe(struct platform_device *pdev)
460{ 461{
461 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 462 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
462 struct platform_device *musb; 463 struct platform_device *musb;
@@ -561,7 +562,7 @@ err0:
561 return ret; 562 return ret;
562} 563}
563 564
564static int __exit am35x_remove(struct platform_device *pdev) 565static int __devexit am35x_remove(struct platform_device *pdev)
565{ 566{
566 struct am35x_glue *glue = platform_get_drvdata(pdev); 567 struct am35x_glue *glue = platform_get_drvdata(pdev);
567 568
@@ -630,7 +631,8 @@ static struct dev_pm_ops am35x_pm_ops = {
630#endif 631#endif
631 632
632static struct platform_driver am35x_driver = { 633static struct platform_driver am35x_driver = {
633 .remove = __exit_p(am35x_remove), 634 .probe = am35x_probe,
635 .remove = __devexit_p(am35x_remove),
634 .driver = { 636 .driver = {
635 .name = "musb-am35x", 637 .name = "musb-am35x",
636 .pm = DEV_PM_OPS, 638 .pm = DEV_PM_OPS,
@@ -643,9 +645,9 @@ MODULE_LICENSE("GPL v2");
643 645
644static int __init am35x_init(void) 646static int __init am35x_init(void)
645{ 647{
646 return platform_driver_probe(&am35x_driver, am35x_probe); 648 return platform_driver_register(&am35x_driver);
647} 649}
648subsys_initcall(am35x_init); 650module_init(am35x_init);
649 651
650static void __exit am35x_exit(void) 652static void __exit am35x_exit(void)
651{ 653{
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 5e7cfba5b079..a087ed6c3be9 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -317,7 +317,7 @@ static void bfin_musb_set_vbus(struct musb *musb, int is_on)
317 musb_readb(musb->mregs, MUSB_DEVCTL)); 317 musb_readb(musb->mregs, MUSB_DEVCTL));
318} 318}
319 319
320static int bfin_musb_set_power(struct otg_transceiver *x, unsigned mA) 320static int bfin_musb_set_power(struct usb_phy *x, unsigned mA)
321{ 321{
322 return 0; 322 return 0;
323} 323}
@@ -415,7 +415,7 @@ static int bfin_musb_init(struct musb *musb)
415 gpio_direction_output(musb->config->gpio_vrsel, 0); 415 gpio_direction_output(musb->config->gpio_vrsel, 0);
416 416
417 usb_nop_xceiv_register(); 417 usb_nop_xceiv_register();
418 musb->xceiv = otg_get_transceiver(); 418 musb->xceiv = usb_get_transceiver();
419 if (!musb->xceiv) { 419 if (!musb->xceiv) {
420 gpio_free(musb->config->gpio_vrsel); 420 gpio_free(musb->config->gpio_vrsel);
421 return -ENODEV; 421 return -ENODEV;
@@ -440,7 +440,7 @@ static int bfin_musb_exit(struct musb *musb)
440{ 440{
441 gpio_free(musb->config->gpio_vrsel); 441 gpio_free(musb->config->gpio_vrsel);
442 442
443 otg_put_transceiver(musb->xceiv); 443 usb_put_transceiver(musb->xceiv);
444 usb_nop_xceiv_unregister(); 444 usb_nop_xceiv_unregister();
445 return 0; 445 return 0;
446} 446}
@@ -463,7 +463,7 @@ static const struct musb_platform_ops bfin_ops = {
463 463
464static u64 bfin_dmamask = DMA_BIT_MASK(32); 464static u64 bfin_dmamask = DMA_BIT_MASK(32);
465 465
466static int __init bfin_probe(struct platform_device *pdev) 466static int __devinit bfin_probe(struct platform_device *pdev)
467{ 467{
468 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 468 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
469 struct platform_device *musb; 469 struct platform_device *musb;
@@ -525,7 +525,7 @@ err0:
525 return ret; 525 return ret;
526} 526}
527 527
528static int __exit bfin_remove(struct platform_device *pdev) 528static int __devexit bfin_remove(struct platform_device *pdev)
529{ 529{
530 struct bfin_glue *glue = platform_get_drvdata(pdev); 530 struct bfin_glue *glue = platform_get_drvdata(pdev);
531 531
@@ -575,6 +575,7 @@ static struct dev_pm_ops bfin_pm_ops = {
575#endif 575#endif
576 576
577static struct platform_driver bfin_driver = { 577static struct platform_driver bfin_driver = {
578 .probe = bfin_probe,
578 .remove = __exit_p(bfin_remove), 579 .remove = __exit_p(bfin_remove),
579 .driver = { 580 .driver = {
580 .name = "musb-blackfin", 581 .name = "musb-blackfin",
@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2");
588 589
589static int __init bfin_init(void) 590static int __init bfin_init(void)
590{ 591{
591 return platform_driver_probe(&bfin_driver, bfin_probe); 592 return platform_driver_register(&bfin_driver);
592} 593}
593subsys_initcall(bfin_init); 594module_init(bfin_init);
594 595
595static void __exit bfin_exit(void) 596static void __exit bfin_exit(void)
596{ 597{
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 2613bfdb09b6..8bd9566f3fbb 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -294,6 +294,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci)
294{ 294{
295 struct musb *musb = hci; 295 struct musb *musb = hci;
296 void __iomem *reg_base = musb->ctrl_base; 296 void __iomem *reg_base = musb->ctrl_base;
297 struct usb_otg *otg = musb->xceiv->otg;
297 unsigned long flags; 298 unsigned long flags;
298 irqreturn_t ret = IRQ_NONE; 299 irqreturn_t ret = IRQ_NONE;
299 u32 status; 300 u32 status;
@@ -351,14 +352,14 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci)
351 WARNING("VBUS error workaround (delay coming)\n"); 352 WARNING("VBUS error workaround (delay coming)\n");
352 } else if (is_host_enabled(musb) && drvvbus) { 353 } else if (is_host_enabled(musb) && drvvbus) {
353 MUSB_HST_MODE(musb); 354 MUSB_HST_MODE(musb);
354 musb->xceiv->default_a = 1; 355 otg->default_a = 1;
355 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 356 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
356 portstate(musb->port1_status |= USB_PORT_STAT_POWER); 357 portstate(musb->port1_status |= USB_PORT_STAT_POWER);
357 del_timer(&otg_workaround); 358 del_timer(&otg_workaround);
358 } else { 359 } else {
359 musb->is_active = 0; 360 musb->is_active = 0;
360 MUSB_DEV_MODE(musb); 361 MUSB_DEV_MODE(musb);
361 musb->xceiv->default_a = 0; 362 otg->default_a = 0;
362 musb->xceiv->state = OTG_STATE_B_IDLE; 363 musb->xceiv->state = OTG_STATE_B_IDLE;
363 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); 364 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
364 } 365 }
@@ -424,7 +425,7 @@ static int da8xx_musb_init(struct musb *musb)
424 goto fail; 425 goto fail;
425 426
426 usb_nop_xceiv_register(); 427 usb_nop_xceiv_register();
427 musb->xceiv = otg_get_transceiver(); 428 musb->xceiv = usb_get_transceiver();
428 if (!musb->xceiv) 429 if (!musb->xceiv)
429 goto fail; 430 goto fail;
430 431
@@ -457,7 +458,7 @@ static int da8xx_musb_exit(struct musb *musb)
457 458
458 phy_off(); 459 phy_off();
459 460
460 otg_put_transceiver(musb->xceiv); 461 usb_put_transceiver(musb->xceiv);
461 usb_nop_xceiv_unregister(); 462 usb_nop_xceiv_unregister();
462 463
463 return 0; 464 return 0;
@@ -478,7 +479,7 @@ static const struct musb_platform_ops da8xx_ops = {
478 479
479static u64 da8xx_dmamask = DMA_BIT_MASK(32); 480static u64 da8xx_dmamask = DMA_BIT_MASK(32);
480 481
481static int __init da8xx_probe(struct platform_device *pdev) 482static int __devinit da8xx_probe(struct platform_device *pdev)
482{ 483{
483 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 484 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
484 struct platform_device *musb; 485 struct platform_device *musb;
@@ -562,7 +563,7 @@ err0:
562 return ret; 563 return ret;
563} 564}
564 565
565static int __exit da8xx_remove(struct platform_device *pdev) 566static int __devexit da8xx_remove(struct platform_device *pdev)
566{ 567{
567 struct da8xx_glue *glue = platform_get_drvdata(pdev); 568 struct da8xx_glue *glue = platform_get_drvdata(pdev);
568 569
@@ -576,7 +577,8 @@ static int __exit da8xx_remove(struct platform_device *pdev)
576} 577}
577 578
578static struct platform_driver da8xx_driver = { 579static struct platform_driver da8xx_driver = {
579 .remove = __exit_p(da8xx_remove), 580 .probe = da8xx_probe,
581 .remove = __devexit_p(da8xx_remove),
580 .driver = { 582 .driver = {
581 .name = "musb-da8xx", 583 .name = "musb-da8xx",
582 }, 584 },
@@ -588,9 +590,9 @@ MODULE_LICENSE("GPL v2");
588 590
589static int __init da8xx_init(void) 591static int __init da8xx_init(void)
590{ 592{
591 return platform_driver_probe(&da8xx_driver, da8xx_probe); 593 return platform_driver_register(&da8xx_driver);
592} 594}
593subsys_initcall(da8xx_init); 595module_init(da8xx_init);
594 596
595static void __exit da8xx_exit(void) 597static void __exit da8xx_exit(void)
596{ 598{
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{
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 3d11cf64ebd1..0f8b82918a40 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -131,9 +131,9 @@ static inline struct musb *dev_to_musb(struct device *dev)
131/*-------------------------------------------------------------------------*/ 131/*-------------------------------------------------------------------------*/
132 132
133#ifndef CONFIG_BLACKFIN 133#ifndef CONFIG_BLACKFIN
134static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset) 134static int musb_ulpi_read(struct usb_phy *phy, u32 offset)
135{ 135{
136 void __iomem *addr = otg->io_priv; 136 void __iomem *addr = phy->io_priv;
137 int i = 0; 137 int i = 0;
138 u8 r; 138 u8 r;
139 u8 power; 139 u8 power;
@@ -165,10 +165,9 @@ static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset)
165 return musb_readb(addr, MUSB_ULPI_REG_DATA); 165 return musb_readb(addr, MUSB_ULPI_REG_DATA);
166} 166}
167 167
168static int musb_ulpi_write(struct otg_transceiver *otg, 168static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data)
169 u32 offset, u32 data)
170{ 169{
171 void __iomem *addr = otg->io_priv; 170 void __iomem *addr = phy->io_priv;
172 int i = 0; 171 int i = 0;
173 u8 r = 0; 172 u8 r = 0;
174 u8 power; 173 u8 power;
@@ -200,7 +199,7 @@ static int musb_ulpi_write(struct otg_transceiver *otg,
200#define musb_ulpi_write NULL 199#define musb_ulpi_write NULL
201#endif 200#endif
202 201
203static struct otg_io_access_ops musb_ulpi_access = { 202static struct usb_phy_io_ops musb_ulpi_access = {
204 .read = musb_ulpi_read, 203 .read = musb_ulpi_read,
205 .write = musb_ulpi_write, 204 .write = musb_ulpi_write,
206}; 205};
@@ -414,6 +413,7 @@ void musb_hnp_stop(struct musb *musb)
414static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, 413static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
415 u8 devctl, u8 power) 414 u8 devctl, u8 power)
416{ 415{
416 struct usb_otg *otg = musb->xceiv->otg;
417 irqreturn_t handled = IRQ_NONE; 417 irqreturn_t handled = IRQ_NONE;
418 418
419 dev_dbg(musb->controller, "<== Power=%02x, DevCtl=%02x, int_usb=0x%x\n", power, devctl, 419 dev_dbg(musb->controller, "<== Power=%02x, DevCtl=%02x, int_usb=0x%x\n", power, devctl,
@@ -626,7 +626,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
626 case OTG_STATE_B_PERIPHERAL: 626 case OTG_STATE_B_PERIPHERAL:
627 musb_g_suspend(musb); 627 musb_g_suspend(musb);
628 musb->is_active = is_otg_enabled(musb) 628 musb->is_active = is_otg_enabled(musb)
629 && musb->xceiv->gadget->b_hnp_enable; 629 && otg->gadget->b_hnp_enable;
630 if (musb->is_active) { 630 if (musb->is_active) {
631 musb->xceiv->state = OTG_STATE_B_WAIT_ACON; 631 musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
632 dev_dbg(musb->controller, "HNP: Setting timer for b_ase0_brst\n"); 632 dev_dbg(musb->controller, "HNP: Setting timer for b_ase0_brst\n");
@@ -643,7 +643,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
643 case OTG_STATE_A_HOST: 643 case OTG_STATE_A_HOST:
644 musb->xceiv->state = OTG_STATE_A_SUSPEND; 644 musb->xceiv->state = OTG_STATE_A_SUSPEND;
645 musb->is_active = is_otg_enabled(musb) 645 musb->is_active = is_otg_enabled(musb)
646 && musb->xceiv->host->b_hnp_enable; 646 && otg->host->b_hnp_enable;
647 break; 647 break;
648 case OTG_STATE_B_HOST: 648 case OTG_STATE_B_HOST:
649 /* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */ 649 /* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */
@@ -1017,12 +1017,12 @@ static void musb_shutdown(struct platform_device *pdev)
1017 || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \ 1017 || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \
1018 || defined(CONFIG_USB_MUSB_AM35X) \ 1018 || defined(CONFIG_USB_MUSB_AM35X) \
1019 || defined(CONFIG_USB_MUSB_AM35X_MODULE) 1019 || defined(CONFIG_USB_MUSB_AM35X_MODULE)
1020static ushort __initdata fifo_mode = 4; 1020static ushort __devinitdata fifo_mode = 4;
1021#elif defined(CONFIG_USB_MUSB_UX500) \ 1021#elif defined(CONFIG_USB_MUSB_UX500) \
1022 || defined(CONFIG_USB_MUSB_UX500_MODULE) 1022 || defined(CONFIG_USB_MUSB_UX500_MODULE)
1023static ushort __initdata fifo_mode = 5; 1023static ushort __devinitdata fifo_mode = 5;
1024#else 1024#else
1025static ushort __initdata fifo_mode = 2; 1025static ushort __devinitdata fifo_mode = 2;
1026#endif 1026#endif
1027 1027
1028/* "modprobe ... fifo_mode=1" etc */ 1028/* "modprobe ... fifo_mode=1" etc */
@@ -1035,7 +1035,7 @@ MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration");
1035 */ 1035 */
1036 1036
1037/* mode 0 - fits in 2KB */ 1037/* mode 0 - fits in 2KB */
1038static struct musb_fifo_cfg __initdata mode_0_cfg[] = { 1038static struct musb_fifo_cfg __devinitdata mode_0_cfg[] = {
1039{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1039{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1040{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1040{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1041{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, }, 1041{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, },
@@ -1044,7 +1044,7 @@ static struct musb_fifo_cfg __initdata mode_0_cfg[] = {
1044}; 1044};
1045 1045
1046/* mode 1 - fits in 4KB */ 1046/* mode 1 - fits in 4KB */
1047static struct musb_fifo_cfg __initdata mode_1_cfg[] = { 1047static struct musb_fifo_cfg __devinitdata mode_1_cfg[] = {
1048{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1048{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1049{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1049{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1050{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1050{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, },
@@ -1053,7 +1053,7 @@ static struct musb_fifo_cfg __initdata mode_1_cfg[] = {
1053}; 1053};
1054 1054
1055/* mode 2 - fits in 4KB */ 1055/* mode 2 - fits in 4KB */
1056static struct musb_fifo_cfg __initdata mode_2_cfg[] = { 1056static struct musb_fifo_cfg __devinitdata mode_2_cfg[] = {
1057{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1057{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1058{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1058{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1059{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1059{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1063,7 +1063,7 @@ static struct musb_fifo_cfg __initdata mode_2_cfg[] = {
1063}; 1063};
1064 1064
1065/* mode 3 - fits in 4KB */ 1065/* mode 3 - fits in 4KB */
1066static struct musb_fifo_cfg __initdata mode_3_cfg[] = { 1066static struct musb_fifo_cfg __devinitdata mode_3_cfg[] = {
1067{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1067{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1068{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1068{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1069{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1069{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1073,7 +1073,7 @@ static struct musb_fifo_cfg __initdata mode_3_cfg[] = {
1073}; 1073};
1074 1074
1075/* mode 4 - fits in 16KB */ 1075/* mode 4 - fits in 16KB */
1076static struct musb_fifo_cfg __initdata mode_4_cfg[] = { 1076static struct musb_fifo_cfg __devinitdata mode_4_cfg[] = {
1077{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1077{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1078{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1078{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1079{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1079{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1104,7 +1104,7 @@ static struct musb_fifo_cfg __initdata mode_4_cfg[] = {
1104}; 1104};
1105 1105
1106/* mode 5 - fits in 8KB */ 1106/* mode 5 - fits in 8KB */
1107static struct musb_fifo_cfg __initdata mode_5_cfg[] = { 1107static struct musb_fifo_cfg __devinitdata mode_5_cfg[] = {
1108{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1108{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1109{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1109{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1110{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1110{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1140,7 +1140,7 @@ static struct musb_fifo_cfg __initdata mode_5_cfg[] = {
1140 * 1140 *
1141 * returns negative errno or offset for next fifo. 1141 * returns negative errno or offset for next fifo.
1142 */ 1142 */
1143static int __init 1143static int __devinit
1144fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, 1144fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
1145 const struct musb_fifo_cfg *cfg, u16 offset) 1145 const struct musb_fifo_cfg *cfg, u16 offset)
1146{ 1146{
@@ -1211,11 +1211,11 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
1211 return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0)); 1211 return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0));
1212} 1212}
1213 1213
1214static struct musb_fifo_cfg __initdata ep0_cfg = { 1214static struct musb_fifo_cfg __devinitdata ep0_cfg = {
1215 .style = FIFO_RXTX, .maxpacket = 64, 1215 .style = FIFO_RXTX, .maxpacket = 64,
1216}; 1216};
1217 1217
1218static int __init ep_config_from_table(struct musb *musb) 1218static int __devinit ep_config_from_table(struct musb *musb)
1219{ 1219{
1220 const struct musb_fifo_cfg *cfg; 1220 const struct musb_fifo_cfg *cfg;
1221 unsigned i, n; 1221 unsigned i, n;
@@ -1306,7 +1306,7 @@ done:
1306 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false 1306 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false
1307 * @param musb the controller 1307 * @param musb the controller
1308 */ 1308 */
1309static int __init ep_config_from_hw(struct musb *musb) 1309static int __devinit ep_config_from_hw(struct musb *musb)
1310{ 1310{
1311 u8 epnum = 0; 1311 u8 epnum = 0;
1312 struct musb_hw_ep *hw_ep; 1312 struct musb_hw_ep *hw_ep;
@@ -1353,7 +1353,7 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, };
1353/* Initialize MUSB (M)HDRC part of the USB hardware subsystem; 1353/* Initialize MUSB (M)HDRC part of the USB hardware subsystem;
1354 * configure endpoints, or take their config from silicon 1354 * configure endpoints, or take their config from silicon
1355 */ 1355 */
1356static int __init musb_core_init(u16 musb_type, struct musb *musb) 1356static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
1357{ 1357{
1358 u8 reg; 1358 u8 reg;
1359 char *type; 1359 char *type;
@@ -1589,7 +1589,7 @@ irqreturn_t musb_interrupt(struct musb *musb)
1589EXPORT_SYMBOL_GPL(musb_interrupt); 1589EXPORT_SYMBOL_GPL(musb_interrupt);
1590 1590
1591#ifndef CONFIG_MUSB_PIO_ONLY 1591#ifndef CONFIG_MUSB_PIO_ONLY
1592static bool __initdata use_dma = 1; 1592static bool __devinitdata use_dma = 1;
1593 1593
1594/* "modprobe ... use_dma=0" etc */ 1594/* "modprobe ... use_dma=0" etc */
1595module_param(use_dma, bool, 0); 1595module_param(use_dma, bool, 0);
@@ -1777,7 +1777,7 @@ static void musb_irq_work(struct work_struct *data)
1777 * Init support 1777 * Init support
1778 */ 1778 */
1779 1779
1780static struct musb *__init 1780static struct musb *__devinit
1781allocate_instance(struct device *dev, 1781allocate_instance(struct device *dev,
1782 struct musb_hdrc_config *config, void __iomem *mbase) 1782 struct musb_hdrc_config *config, void __iomem *mbase)
1783{ 1783{
@@ -1853,7 +1853,7 @@ static void musb_free(struct musb *musb)
1853 * @mregs: virtual address of controller registers, 1853 * @mregs: virtual address of controller registers,
1854 * not yet corrected for platform-specific offsets 1854 * not yet corrected for platform-specific offsets
1855 */ 1855 */
1856static int __init 1856static int __devinit
1857musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) 1857musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1858{ 1858{
1859 int status; 1859 int status;
@@ -1961,11 +1961,11 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1961 if (is_host_enabled(musb)) { 1961 if (is_host_enabled(musb)) {
1962 struct usb_hcd *hcd = musb_to_hcd(musb); 1962 struct usb_hcd *hcd = musb_to_hcd(musb);
1963 1963
1964 otg_set_host(musb->xceiv, &hcd->self); 1964 otg_set_host(musb->xceiv->otg, &hcd->self);
1965 1965
1966 if (is_otg_enabled(musb)) 1966 if (is_otg_enabled(musb))
1967 hcd->self.otg_port = 1; 1967 hcd->self.otg_port = 1;
1968 musb->xceiv->host = &hcd->self; 1968 musb->xceiv->otg->host = &hcd->self;
1969 hcd->power_budget = 2 * (plat->power ? : 250); 1969 hcd->power_budget = 2 * (plat->power ? : 250);
1970 1970
1971 /* program PHY to use external vBus if required */ 1971 /* program PHY to use external vBus if required */
@@ -1984,10 +1984,10 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1984 struct usb_hcd *hcd = musb_to_hcd(musb); 1984 struct usb_hcd *hcd = musb_to_hcd(musb);
1985 1985
1986 MUSB_HST_MODE(musb); 1986 MUSB_HST_MODE(musb);
1987 musb->xceiv->default_a = 1; 1987 musb->xceiv->otg->default_a = 1;
1988 musb->xceiv->state = OTG_STATE_A_IDLE; 1988 musb->xceiv->state = OTG_STATE_A_IDLE;
1989 1989
1990 status = usb_add_hcd(musb_to_hcd(musb), -1, 0); 1990 status = usb_add_hcd(musb_to_hcd(musb), 0, 0);
1991 1991
1992 hcd->self.uses_pio_for_control = 1; 1992 hcd->self.uses_pio_for_control = 1;
1993 dev_dbg(musb->controller, "%s mode, status %d, devctl %02x %c\n", 1993 dev_dbg(musb->controller, "%s mode, status %d, devctl %02x %c\n",
@@ -1999,7 +1999,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1999 1999
2000 } else /* peripheral is enabled */ { 2000 } else /* peripheral is enabled */ {
2001 MUSB_DEV_MODE(musb); 2001 MUSB_DEV_MODE(musb);
2002 musb->xceiv->default_a = 0; 2002 musb->xceiv->otg->default_a = 0;
2003 musb->xceiv->state = OTG_STATE_B_IDLE; 2003 musb->xceiv->state = OTG_STATE_B_IDLE;
2004 2004
2005 status = musb_gadget_setup(musb); 2005 status = musb_gadget_setup(musb);
@@ -2073,7 +2073,7 @@ fail0:
2073static u64 *orig_dma_mask; 2073static u64 *orig_dma_mask;
2074#endif 2074#endif
2075 2075
2076static int __init musb_probe(struct platform_device *pdev) 2076static int __devinit musb_probe(struct platform_device *pdev)
2077{ 2077{
2078 struct device *dev = &pdev->dev; 2078 struct device *dev = &pdev->dev;
2079 int irq = platform_get_irq_byname(pdev, "mc"); 2079 int irq = platform_get_irq_byname(pdev, "mc");
@@ -2102,7 +2102,7 @@ static int __init musb_probe(struct platform_device *pdev)
2102 return status; 2102 return status;
2103} 2103}
2104 2104
2105static int __exit musb_remove(struct platform_device *pdev) 2105static int __devexit musb_remove(struct platform_device *pdev)
2106{ 2106{
2107 struct musb *musb = dev_to_musb(&pdev->dev); 2107 struct musb *musb = dev_to_musb(&pdev->dev);
2108 void __iomem *ctrl_base = musb->ctrl_base; 2108 void __iomem *ctrl_base = musb->ctrl_base;
@@ -2112,11 +2112,9 @@ static int __exit musb_remove(struct platform_device *pdev)
2112 * - Peripheral mode: peripheral is deactivated (or never-activated) 2112 * - Peripheral mode: peripheral is deactivated (or never-activated)
2113 * - OTG mode: both roles are deactivated (or never-activated) 2113 * - OTG mode: both roles are deactivated (or never-activated)
2114 */ 2114 */
2115 pm_runtime_get_sync(musb->controller);
2116 musb_exit_debugfs(musb); 2115 musb_exit_debugfs(musb);
2117 musb_shutdown(pdev); 2116 musb_shutdown(pdev);
2118 2117
2119 pm_runtime_put(musb->controller);
2120 musb_free(musb); 2118 musb_free(musb);
2121 iounmap(ctrl_base); 2119 iounmap(ctrl_base);
2122 device_init_wakeup(&pdev->dev, 0); 2120 device_init_wakeup(&pdev->dev, 0);
@@ -2364,7 +2362,8 @@ static struct platform_driver musb_driver = {
2364 .owner = THIS_MODULE, 2362 .owner = THIS_MODULE,
2365 .pm = MUSB_DEV_PM_OPS, 2363 .pm = MUSB_DEV_PM_OPS,
2366 }, 2364 },
2367 .remove = __exit_p(musb_remove), 2365 .probe = musb_probe,
2366 .remove = __devexit_p(musb_remove),
2368 .shutdown = musb_shutdown, 2367 .shutdown = musb_shutdown,
2369}; 2368};
2370 2369
@@ -2380,13 +2379,9 @@ static int __init musb_init(void)
2380 ", " 2379 ", "
2381 "otg (peripheral+host)", 2380 "otg (peripheral+host)",
2382 musb_driver_name); 2381 musb_driver_name);
2383 return platform_driver_probe(&musb_driver, musb_probe); 2382 return platform_driver_register(&musb_driver);
2384} 2383}
2385 2384module_init(musb_init);
2386/* make us init after usbcore and i2c (transceivers, regulators, etc)
2387 * and before usb gadget and host-side drivers start to register
2388 */
2389fs_initcall(musb_init);
2390 2385
2391static void __exit musb_cleanup(void) 2386static void __exit musb_cleanup(void)
2392{ 2387{
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 3d28fb8a2dc9..93de517a32a0 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -372,7 +372,7 @@ struct musb {
372 u16 int_rx; 372 u16 int_rx;
373 u16 int_tx; 373 u16 int_tx;
374 374
375 struct otg_transceiver *xceiv; 375 struct usb_phy *xceiv;
376 u8 xceiv_event; 376 u8 xceiv_event;
377 377
378 int nIrq; 378 int nIrq;
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 13d9af9bf920..40a37c91cc10 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -235,29 +235,29 @@ static const struct file_operations musb_test_mode_fops = {
235 .release = single_release, 235 .release = single_release,
236}; 236};
237 237
238int __init musb_init_debugfs(struct musb *musb) 238int __devinit musb_init_debugfs(struct musb *musb)
239{ 239{
240 struct dentry *root; 240 struct dentry *root;
241 struct dentry *file; 241 struct dentry *file;
242 int ret; 242 int ret;
243 243
244 root = debugfs_create_dir("musb", NULL); 244 root = debugfs_create_dir("musb", NULL);
245 if (IS_ERR(root)) { 245 if (!root) {
246 ret = PTR_ERR(root); 246 ret = -ENOMEM;
247 goto err0; 247 goto err0;
248 } 248 }
249 249
250 file = debugfs_create_file("regdump", S_IRUGO, root, musb, 250 file = debugfs_create_file("regdump", S_IRUGO, root, musb,
251 &musb_regdump_fops); 251 &musb_regdump_fops);
252 if (IS_ERR(file)) { 252 if (!file) {
253 ret = PTR_ERR(file); 253 ret = -ENOMEM;
254 goto err1; 254 goto err1;
255 } 255 }
256 256
257 file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, 257 file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
258 root, musb, &musb_test_mode_fops); 258 root, musb, &musb_test_mode_fops);
259 if (IS_ERR(file)) { 259 if (!file) {
260 ret = PTR_ERR(file); 260 ret = -ENOMEM;
261 goto err1; 261 goto err1;
262 } 262 }
263 263
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index ac3d2eec20fe..f42c29b11f71 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -574,6 +574,15 @@ void musb_g_tx(struct musb *musb, u8 epnum)
574 574
575 if (request->actual == request->length) { 575 if (request->actual == request->length) {
576 musb_g_giveback(musb_ep, request, 0); 576 musb_g_giveback(musb_ep, request, 0);
577 /*
578 * In the giveback function the MUSB lock is
579 * released and acquired after sometime. During
580 * this time period the INDEX register could get
581 * changed by the gadget_queue function especially
582 * on SMP systems. Reselect the INDEX to be sure
583 * we are reading/modifying the right registers
584 */
585 musb_ep_select(mbase, epnum);
577 req = musb_ep->desc ? next_request(musb_ep) : NULL; 586 req = musb_ep->desc ? next_request(musb_ep) : NULL;
578 if (!req) { 587 if (!req) {
579 dev_dbg(musb->controller, "%s idle now\n", 588 dev_dbg(musb->controller, "%s idle now\n",
@@ -983,6 +992,15 @@ void musb_g_rx(struct musb *musb, u8 epnum)
983 } 992 }
984#endif 993#endif
985 musb_g_giveback(musb_ep, request, 0); 994 musb_g_giveback(musb_ep, request, 0);
995 /*
996 * In the giveback function the MUSB lock is
997 * released and acquired after sometime. During
998 * this time period the INDEX register could get
999 * changed by the gadget_queue function especially
1000 * on SMP systems. Reselect the INDEX to be sure
1001 * we are reading/modifying the right registers
1002 */
1003 musb_ep_select(mbase, epnum);
986 1004
987 req = next_request(musb_ep); 1005 req = next_request(musb_ep);
988 if (!req) 1006 if (!req)
@@ -1624,7 +1642,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget)
1624 } 1642 }
1625 1643
1626 spin_unlock_irqrestore(&musb->lock, flags); 1644 spin_unlock_irqrestore(&musb->lock, flags);
1627 otg_start_srp(musb->xceiv); 1645 otg_start_srp(musb->xceiv->otg);
1628 spin_lock_irqsave(&musb->lock, flags); 1646 spin_lock_irqsave(&musb->lock, flags);
1629 1647
1630 /* Block idling for at least 1s */ 1648 /* Block idling for at least 1s */
@@ -1703,7 +1721,7 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
1703 1721
1704 if (!musb->xceiv->set_power) 1722 if (!musb->xceiv->set_power)
1705 return -EOPNOTSUPP; 1723 return -EOPNOTSUPP;
1706 return otg_set_power(musb->xceiv, mA); 1724 return usb_phy_set_power(musb->xceiv, mA);
1707} 1725}
1708 1726
1709static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) 1727static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)
@@ -1762,7 +1780,7 @@ static void musb_gadget_release(struct device *dev)
1762} 1780}
1763 1781
1764 1782
1765static void __init 1783static void __devinit
1766init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) 1784init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
1767{ 1785{
1768 struct musb_hw_ep *hw_ep = musb->endpoints + epnum; 1786 struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
@@ -1799,7 +1817,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
1799 * Initialize the endpoints exposed to peripheral drivers, with backlinks 1817 * Initialize the endpoints exposed to peripheral drivers, with backlinks
1800 * to the rest of the driver state. 1818 * to the rest of the driver state.
1801 */ 1819 */
1802static inline void __init musb_g_init_endpoints(struct musb *musb) 1820static inline void __devinit musb_g_init_endpoints(struct musb *musb)
1803{ 1821{
1804 u8 epnum; 1822 u8 epnum;
1805 struct musb_hw_ep *hw_ep; 1823 struct musb_hw_ep *hw_ep;
@@ -1832,7 +1850,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb)
1832/* called once during driver setup to initialize and link into 1850/* called once during driver setup to initialize and link into
1833 * the driver model; memory is zeroed. 1851 * the driver model; memory is zeroed.
1834 */ 1852 */
1835int __init musb_gadget_setup(struct musb *musb) 1853int __devinit musb_gadget_setup(struct musb *musb)
1836{ 1854{
1837 int status; 1855 int status;
1838 1856
@@ -1898,6 +1916,7 @@ static int musb_gadget_start(struct usb_gadget *g,
1898 struct usb_gadget_driver *driver) 1916 struct usb_gadget_driver *driver)
1899{ 1917{
1900 struct musb *musb = gadget_to_musb(g); 1918 struct musb *musb = gadget_to_musb(g);
1919 struct usb_otg *otg = musb->xceiv->otg;
1901 unsigned long flags; 1920 unsigned long flags;
1902 int retval = -EINVAL; 1921 int retval = -EINVAL;
1903 1922
@@ -1914,7 +1933,7 @@ static int musb_gadget_start(struct usb_gadget *g,
1914 spin_lock_irqsave(&musb->lock, flags); 1933 spin_lock_irqsave(&musb->lock, flags);
1915 musb->is_active = 1; 1934 musb->is_active = 1;
1916 1935
1917 otg_set_peripheral(musb->xceiv, &musb->g); 1936 otg_set_peripheral(otg, &musb->g);
1918 musb->xceiv->state = OTG_STATE_B_IDLE; 1937 musb->xceiv->state = OTG_STATE_B_IDLE;
1919 1938
1920 /* 1939 /*
@@ -1938,15 +1957,15 @@ static int musb_gadget_start(struct usb_gadget *g,
1938 * handles power budgeting ... this way also 1957 * handles power budgeting ... this way also
1939 * ensures HdrcStart is indirectly called. 1958 * ensures HdrcStart is indirectly called.
1940 */ 1959 */
1941 retval = usb_add_hcd(musb_to_hcd(musb), -1, 0); 1960 retval = usb_add_hcd(musb_to_hcd(musb), 0, 0);
1942 if (retval < 0) { 1961 if (retval < 0) {
1943 dev_dbg(musb->controller, "add_hcd failed, %d\n", retval); 1962 dev_dbg(musb->controller, "add_hcd failed, %d\n", retval);
1944 goto err2; 1963 goto err2;
1945 } 1964 }
1946 1965
1947 if ((musb->xceiv->last_event == USB_EVENT_ID) 1966 if ((musb->xceiv->last_event == USB_EVENT_ID)
1948 && musb->xceiv->set_vbus) 1967 && otg->set_vbus)
1949 otg_set_vbus(musb->xceiv, 1); 1968 otg_set_vbus(otg, 1);
1950 1969
1951 hcd->self.uses_pio_for_control = 1; 1970 hcd->self.uses_pio_for_control = 1;
1952 } 1971 }
@@ -2028,7 +2047,7 @@ static int musb_gadget_stop(struct usb_gadget *g,
2028 2047
2029 musb->xceiv->state = OTG_STATE_UNDEFINED; 2048 musb->xceiv->state = OTG_STATE_UNDEFINED;
2030 stop_activity(musb, driver); 2049 stop_activity(musb, driver);
2031 otg_set_peripheral(musb->xceiv, NULL); 2050 otg_set_peripheral(musb->xceiv->otg, NULL);
2032 2051
2033 dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); 2052 dev_dbg(musb->controller, "unregistering driver %s\n", driver->function);
2034 2053
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index e9f80adc45a4..22ec3e379980 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -47,6 +47,7 @@
47 47
48static void musb_port_suspend(struct musb *musb, bool do_suspend) 48static void musb_port_suspend(struct musb *musb, bool do_suspend)
49{ 49{
50 struct usb_otg *otg = musb->xceiv->otg;
50 u8 power; 51 u8 power;
51 void __iomem *mbase = musb->mregs; 52 void __iomem *mbase = musb->mregs;
52 53
@@ -81,7 +82,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend)
81 case OTG_STATE_A_HOST: 82 case OTG_STATE_A_HOST:
82 musb->xceiv->state = OTG_STATE_A_SUSPEND; 83 musb->xceiv->state = OTG_STATE_A_SUSPEND;
83 musb->is_active = is_otg_enabled(musb) 84 musb->is_active = is_otg_enabled(musb)
84 && musb->xceiv->host->b_hnp_enable; 85 && otg->host->b_hnp_enable;
85 if (musb->is_active) 86 if (musb->is_active)
86 mod_timer(&musb->otg_timer, jiffies 87 mod_timer(&musb->otg_timer, jiffies
87 + msecs_to_jiffies( 88 + msecs_to_jiffies(
@@ -91,7 +92,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend)
91 case OTG_STATE_B_HOST: 92 case OTG_STATE_B_HOST:
92 musb->xceiv->state = OTG_STATE_B_WAIT_ACON; 93 musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
93 musb->is_active = is_otg_enabled(musb) 94 musb->is_active = is_otg_enabled(musb)
94 && musb->xceiv->host->b_hnp_enable; 95 && otg->host->b_hnp_enable;
95 musb_platform_try_idle(musb, 0); 96 musb_platform_try_idle(musb, 0);
96 break; 97 break;
97 default: 98 default:
@@ -179,6 +180,8 @@ static void musb_port_reset(struct musb *musb, bool do_reset)
179 180
180void musb_root_disconnect(struct musb *musb) 181void musb_root_disconnect(struct musb *musb)
181{ 182{
183 struct usb_otg *otg = musb->xceiv->otg;
184
182 musb->port1_status = USB_PORT_STAT_POWER 185 musb->port1_status = USB_PORT_STAT_POWER
183 | (USB_PORT_STAT_C_CONNECTION << 16); 186 | (USB_PORT_STAT_C_CONNECTION << 16);
184 187
@@ -188,7 +191,7 @@ void musb_root_disconnect(struct musb *musb)
188 switch (musb->xceiv->state) { 191 switch (musb->xceiv->state) {
189 case OTG_STATE_A_SUSPEND: 192 case OTG_STATE_A_SUSPEND:
190 if (is_otg_enabled(musb) 193 if (is_otg_enabled(musb)
191 && musb->xceiv->host->b_hnp_enable) { 194 && otg->host->b_hnp_enable) {
192 musb->xceiv->state = OTG_STATE_A_PERIPHERAL; 195 musb->xceiv->state = OTG_STATE_A_PERIPHERAL;
193 musb->g.is_a_peripheral = 1; 196 musb->g.is_a_peripheral = 1;
194 break; 197 break;
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index df719eae3b03..2ae0bb309994 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -132,6 +132,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
132 132
133static void omap2430_musb_set_vbus(struct musb *musb, int is_on) 133static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
134{ 134{
135 struct usb_otg *otg = musb->xceiv->otg;
135 u8 devctl; 136 u8 devctl;
136 unsigned long timeout = jiffies + msecs_to_jiffies(1000); 137 unsigned long timeout = jiffies + msecs_to_jiffies(1000);
137 int ret = 1; 138 int ret = 1;
@@ -163,11 +164,11 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
163 } 164 }
164 } 165 }
165 166
166 if (ret && musb->xceiv->set_vbus) 167 if (ret && otg->set_vbus)
167 otg_set_vbus(musb->xceiv, 1); 168 otg_set_vbus(otg, 1);
168 } else { 169 } else {
169 musb->is_active = 1; 170 musb->is_active = 1;
170 musb->xceiv->default_a = 1; 171 otg->default_a = 1;
171 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 172 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
172 devctl |= MUSB_DEVCTL_SESSION; 173 devctl |= MUSB_DEVCTL_SESSION;
173 MUSB_HST_MODE(musb); 174 MUSB_HST_MODE(musb);
@@ -179,7 +180,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
179 * jumping right to B_IDLE... 180 * jumping right to B_IDLE...
180 */ 181 */
181 182
182 musb->xceiv->default_a = 0; 183 otg->default_a = 0;
183 musb->xceiv->state = OTG_STATE_B_IDLE; 184 musb->xceiv->state = OTG_STATE_B_IDLE;
184 devctl &= ~MUSB_DEVCTL_SESSION; 185 devctl &= ~MUSB_DEVCTL_SESSION;
185 186
@@ -246,7 +247,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
246 247
247 if (!is_otg_enabled(musb) || musb->gadget_driver) { 248 if (!is_otg_enabled(musb) || musb->gadget_driver) {
248 pm_runtime_get_sync(musb->controller); 249 pm_runtime_get_sync(musb->controller);
249 otg_init(musb->xceiv); 250 usb_phy_init(musb->xceiv);
250 omap2430_musb_set_vbus(musb, 1); 251 omap2430_musb_set_vbus(musb, 1);
251 } 252 }
252 break; 253 break;
@@ -256,7 +257,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
256 257
257 if (musb->gadget_driver) 258 if (musb->gadget_driver)
258 pm_runtime_get_sync(musb->controller); 259 pm_runtime_get_sync(musb->controller);
259 otg_init(musb->xceiv); 260 usb_phy_init(musb->xceiv);
260 break; 261 break;
261 262
262 case USB_EVENT_NONE: 263 case USB_EVENT_NONE:
@@ -269,10 +270,10 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
269 } 270 }
270 271
271 if (data->interface_type == MUSB_INTERFACE_UTMI) { 272 if (data->interface_type == MUSB_INTERFACE_UTMI) {
272 if (musb->xceiv->set_vbus) 273 if (musb->xceiv->otg->set_vbus)
273 otg_set_vbus(musb->xceiv, 0); 274 otg_set_vbus(musb->xceiv->otg, 0);
274 } 275 }
275 otg_shutdown(musb->xceiv); 276 usb_phy_shutdown(musb->xceiv);
276 break; 277 break;
277 default: 278 default:
278 dev_dbg(musb->controller, "ID float\n"); 279 dev_dbg(musb->controller, "ID float\n");
@@ -290,7 +291,7 @@ static int omap2430_musb_init(struct musb *musb)
290 * up through ULPI. TWL4030-family PMICs include one, 291 * up through ULPI. TWL4030-family PMICs include one,
291 * which needs a driver, drivers aren't always needed. 292 * which needs a driver, drivers aren't always needed.
292 */ 293 */
293 musb->xceiv = otg_get_transceiver(); 294 musb->xceiv = usb_get_transceiver();
294 if (!musb->xceiv) { 295 if (!musb->xceiv) {
295 pr_err("HS USB OTG: no transceiver configured\n"); 296 pr_err("HS USB OTG: no transceiver configured\n");
296 return -ENODEV; 297 return -ENODEV;
@@ -325,7 +326,7 @@ static int omap2430_musb_init(struct musb *musb)
325 musb_readl(musb->mregs, OTG_SIMENABLE)); 326 musb_readl(musb->mregs, OTG_SIMENABLE));
326 327
327 musb->nb.notifier_call = musb_otg_notifications; 328 musb->nb.notifier_call = musb_otg_notifications;
328 status = otg_register_notifier(musb->xceiv, &musb->nb); 329 status = usb_register_notifier(musb->xceiv, &musb->nb);
329 330
330 if (status) 331 if (status)
331 dev_dbg(musb->controller, "notification register failed\n"); 332 dev_dbg(musb->controller, "notification register failed\n");
@@ -349,7 +350,7 @@ static void omap2430_musb_enable(struct musb *musb)
349 switch (musb->xceiv->last_event) { 350 switch (musb->xceiv->last_event) {
350 351
351 case USB_EVENT_ID: 352 case USB_EVENT_ID:
352 otg_init(musb->xceiv); 353 usb_phy_init(musb->xceiv);
353 if (data->interface_type != MUSB_INTERFACE_UTMI) 354 if (data->interface_type != MUSB_INTERFACE_UTMI)
354 break; 355 break;
355 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); 356 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
@@ -368,7 +369,7 @@ static void omap2430_musb_enable(struct musb *musb)
368 break; 369 break;
369 370
370 case USB_EVENT_VBUS: 371 case USB_EVENT_VBUS:
371 otg_init(musb->xceiv); 372 usb_phy_init(musb->xceiv);
372 break; 373 break;
373 374
374 default: 375 default:
@@ -379,7 +380,7 @@ static void omap2430_musb_enable(struct musb *musb)
379static void omap2430_musb_disable(struct musb *musb) 380static void omap2430_musb_disable(struct musb *musb)
380{ 381{
381 if (musb->xceiv->last_event) 382 if (musb->xceiv->last_event)
382 otg_shutdown(musb->xceiv); 383 usb_phy_shutdown(musb->xceiv);
383} 384}
384 385
385static int omap2430_musb_exit(struct musb *musb) 386static int omap2430_musb_exit(struct musb *musb)
@@ -388,7 +389,7 @@ static int omap2430_musb_exit(struct musb *musb)
388 cancel_work_sync(&musb->otg_notifier_work); 389 cancel_work_sync(&musb->otg_notifier_work);
389 390
390 omap2430_low_level_exit(musb); 391 omap2430_low_level_exit(musb);
391 otg_put_transceiver(musb->xceiv); 392 usb_put_transceiver(musb->xceiv);
392 393
393 return 0; 394 return 0;
394} 395}
@@ -408,7 +409,7 @@ static const struct musb_platform_ops omap2430_ops = {
408 409
409static u64 omap2430_dmamask = DMA_BIT_MASK(32); 410static u64 omap2430_dmamask = DMA_BIT_MASK(32);
410 411
411static int __init omap2430_probe(struct platform_device *pdev) 412static int __devinit omap2430_probe(struct platform_device *pdev)
412{ 413{
413 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 414 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
414 struct platform_device *musb; 415 struct platform_device *musb;
@@ -471,7 +472,7 @@ err0:
471 return ret; 472 return ret;
472} 473}
473 474
474static int __exit omap2430_remove(struct platform_device *pdev) 475static int __devexit omap2430_remove(struct platform_device *pdev)
475{ 476{
476 struct omap2430_glue *glue = platform_get_drvdata(pdev); 477 struct omap2430_glue *glue = platform_get_drvdata(pdev);
477 478
@@ -494,7 +495,7 @@ static int omap2430_runtime_suspend(struct device *dev)
494 OTG_INTERFSEL); 495 OTG_INTERFSEL);
495 496
496 omap2430_low_level_exit(musb); 497 omap2430_low_level_exit(musb);
497 otg_set_suspend(musb->xceiv, 1); 498 usb_phy_set_suspend(musb->xceiv, 1);
498 499
499 return 0; 500 return 0;
500} 501}
@@ -508,7 +509,7 @@ static int omap2430_runtime_resume(struct device *dev)
508 musb_writel(musb->mregs, OTG_INTERFSEL, 509 musb_writel(musb->mregs, OTG_INTERFSEL,
509 musb->context.otg_interfsel); 510 musb->context.otg_interfsel);
510 511
511 otg_set_suspend(musb->xceiv, 0); 512 usb_phy_set_suspend(musb->xceiv, 0);
512 513
513 return 0; 514 return 0;
514} 515}
@@ -524,7 +525,8 @@ static struct dev_pm_ops omap2430_pm_ops = {
524#endif 525#endif
525 526
526static struct platform_driver omap2430_driver = { 527static struct platform_driver omap2430_driver = {
527 .remove = __exit_p(omap2430_remove), 528 .probe = omap2430_probe,
529 .remove = __devexit_p(omap2430_remove),
528 .driver = { 530 .driver = {
529 .name = "musb-omap2430", 531 .name = "musb-omap2430",
530 .pm = DEV_PM_OPS, 532 .pm = DEV_PM_OPS,
@@ -537,9 +539,9 @@ MODULE_LICENSE("GPL v2");
537 539
538static int __init omap2430_init(void) 540static int __init omap2430_init(void)
539{ 541{
540 return platform_driver_probe(&omap2430_driver, omap2430_probe); 542 return platform_driver_register(&omap2430_driver);
541} 543}
542subsys_initcall(omap2430_init); 544module_init(omap2430_init);
543 545
544static void __exit omap2430_exit(void) 546static void __exit omap2430_exit(void)
545{ 547{
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 1f405616e6cd..de1355946a83 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -277,7 +277,7 @@ static struct musb *the_musb;
277 * mode), or low power Default-B sessions, something else supplies power. 277 * mode), or low power Default-B sessions, something else supplies power.
278 * Caller must take care of locking. 278 * Caller must take care of locking.
279 */ 279 */
280static int tusb_draw_power(struct otg_transceiver *x, unsigned mA) 280static int tusb_draw_power(struct usb_phy *x, unsigned mA)
281{ 281{
282 struct musb *musb = the_musb; 282 struct musb *musb = the_musb;
283 void __iomem *tbase = musb->ctrl_base; 283 void __iomem *tbase = musb->ctrl_base;
@@ -293,7 +293,7 @@ static int tusb_draw_power(struct otg_transceiver *x, unsigned mA)
293 * The actual current usage would be very board-specific. For now, 293 * The actual current usage would be very board-specific. For now,
294 * it's simpler to just use an aggregate (also board-specific). 294 * it's simpler to just use an aggregate (also board-specific).
295 */ 295 */
296 if (x->default_a || mA < (musb->min_power << 1)) 296 if (x->otg->default_a || mA < (musb->min_power << 1))
297 mA = 0; 297 mA = 0;
298 298
299 reg = musb_readl(tbase, TUSB_PRCM_MNGMT); 299 reg = musb_readl(tbase, TUSB_PRCM_MNGMT);
@@ -510,6 +510,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on)
510 void __iomem *tbase = musb->ctrl_base; 510 void __iomem *tbase = musb->ctrl_base;
511 u32 conf, prcm, timer; 511 u32 conf, prcm, timer;
512 u8 devctl; 512 u8 devctl;
513 struct usb_otg *otg = musb->xceiv->otg;
513 514
514 /* HDRC controls CPEN, but beware current surges during device 515 /* HDRC controls CPEN, but beware current surges during device
515 * connect. They can trigger transient overcurrent conditions 516 * connect. They can trigger transient overcurrent conditions
@@ -522,7 +523,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on)
522 523
523 if (is_on) { 524 if (is_on) {
524 timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE); 525 timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE);
525 musb->xceiv->default_a = 1; 526 otg->default_a = 1;
526 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 527 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
527 devctl |= MUSB_DEVCTL_SESSION; 528 devctl |= MUSB_DEVCTL_SESSION;
528 529
@@ -548,11 +549,11 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on)
548 musb->xceiv->state = OTG_STATE_A_IDLE; 549 musb->xceiv->state = OTG_STATE_A_IDLE;
549 } 550 }
550 musb->is_active = 0; 551 musb->is_active = 0;
551 musb->xceiv->default_a = 1; 552 otg->default_a = 1;
552 MUSB_HST_MODE(musb); 553 MUSB_HST_MODE(musb);
553 } else { 554 } else {
554 musb->is_active = 0; 555 musb->is_active = 0;
555 musb->xceiv->default_a = 0; 556 otg->default_a = 0;
556 musb->xceiv->state = OTG_STATE_B_IDLE; 557 musb->xceiv->state = OTG_STATE_B_IDLE;
557 MUSB_DEV_MODE(musb); 558 MUSB_DEV_MODE(musb);
558 } 559 }
@@ -644,6 +645,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
644{ 645{
645 u32 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); 646 u32 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT);
646 unsigned long idle_timeout = 0; 647 unsigned long idle_timeout = 0;
648 struct usb_otg *otg = musb->xceiv->otg;
647 649
648 /* ID pin */ 650 /* ID pin */
649 if ((int_src & TUSB_INT_SRC_ID_STATUS_CHNG)) { 651 if ((int_src & TUSB_INT_SRC_ID_STATUS_CHNG)) {
@@ -654,7 +656,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
654 else 656 else
655 default_a = is_host_enabled(musb); 657 default_a = is_host_enabled(musb);
656 dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B'); 658 dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B');
657 musb->xceiv->default_a = default_a; 659 otg->default_a = default_a;
658 tusb_musb_set_vbus(musb, default_a); 660 tusb_musb_set_vbus(musb, default_a);
659 661
660 /* Don't allow idling immediately */ 662 /* Don't allow idling immediately */
@@ -666,7 +668,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
666 if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) { 668 if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) {
667 669
668 /* B-dev state machine: no vbus ~= disconnect */ 670 /* B-dev state machine: no vbus ~= disconnect */
669 if ((is_otg_enabled(musb) && !musb->xceiv->default_a) 671 if ((is_otg_enabled(musb) && !otg->default_a)
670 || !is_host_enabled(musb)) { 672 || !is_host_enabled(musb)) {
671 /* ? musb_root_disconnect(musb); */ 673 /* ? musb_root_disconnect(musb); */
672 musb->port1_status &= 674 musb->port1_status &=
@@ -1076,7 +1078,7 @@ static int tusb_musb_init(struct musb *musb)
1076 int ret; 1078 int ret;
1077 1079
1078 usb_nop_xceiv_register(); 1080 usb_nop_xceiv_register();
1079 musb->xceiv = otg_get_transceiver(); 1081 musb->xceiv = usb_get_transceiver();
1080 if (!musb->xceiv) 1082 if (!musb->xceiv)
1081 return -ENODEV; 1083 return -ENODEV;
1082 1084
@@ -1128,7 +1130,7 @@ done:
1128 if (sync) 1130 if (sync)
1129 iounmap(sync); 1131 iounmap(sync);
1130 1132
1131 otg_put_transceiver(musb->xceiv); 1133 usb_put_transceiver(musb->xceiv);
1132 usb_nop_xceiv_unregister(); 1134 usb_nop_xceiv_unregister();
1133 } 1135 }
1134 return ret; 1136 return ret;
@@ -1144,7 +1146,7 @@ static int tusb_musb_exit(struct musb *musb)
1144 1146
1145 iounmap(musb->sync_va); 1147 iounmap(musb->sync_va);
1146 1148
1147 otg_put_transceiver(musb->xceiv); 1149 usb_put_transceiver(musb->xceiv);
1148 usb_nop_xceiv_unregister(); 1150 usb_nop_xceiv_unregister();
1149 return 0; 1151 return 0;
1150} 1152}
@@ -1165,7 +1167,7 @@ static const struct musb_platform_ops tusb_ops = {
1165 1167
1166static u64 tusb_dmamask = DMA_BIT_MASK(32); 1168static u64 tusb_dmamask = DMA_BIT_MASK(32);
1167 1169
1168static int __init tusb_probe(struct platform_device *pdev) 1170static int __devinit tusb_probe(struct platform_device *pdev)
1169{ 1171{
1170 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 1172 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
1171 struct platform_device *musb; 1173 struct platform_device *musb;
@@ -1227,7 +1229,7 @@ err0:
1227 return ret; 1229 return ret;
1228} 1230}
1229 1231
1230static int __exit tusb_remove(struct platform_device *pdev) 1232static int __devexit tusb_remove(struct platform_device *pdev)
1231{ 1233{
1232 struct tusb6010_glue *glue = platform_get_drvdata(pdev); 1234 struct tusb6010_glue *glue = platform_get_drvdata(pdev);
1233 1235
@@ -1239,7 +1241,8 @@ static int __exit tusb_remove(struct platform_device *pdev)
1239} 1241}
1240 1242
1241static struct platform_driver tusb_driver = { 1243static struct platform_driver tusb_driver = {
1242 .remove = __exit_p(tusb_remove), 1244 .probe = tusb_probe,
1245 .remove = __devexit_p(tusb_remove),
1243 .driver = { 1246 .driver = {
1244 .name = "musb-tusb", 1247 .name = "musb-tusb",
1245 }, 1248 },
@@ -1251,9 +1254,9 @@ MODULE_LICENSE("GPL v2");
1251 1254
1252static int __init tusb_init(void) 1255static int __init tusb_init(void)
1253{ 1256{
1254 return platform_driver_probe(&tusb_driver, tusb_probe); 1257 return platform_driver_register(&tusb_driver);
1255} 1258}
1256subsys_initcall(tusb_init); 1259module_init(tusb_init);
1257 1260
1258static void __exit tusb_exit(void) 1261static void __exit tusb_exit(void)
1259{ 1262{
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index f7e04bf34a13..aa09dd417b94 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -37,7 +37,7 @@ struct ux500_glue {
37 37
38static int ux500_musb_init(struct musb *musb) 38static int ux500_musb_init(struct musb *musb)
39{ 39{
40 musb->xceiv = otg_get_transceiver(); 40 musb->xceiv = usb_get_transceiver();
41 if (!musb->xceiv) { 41 if (!musb->xceiv) {
42 pr_err("HS USB OTG: no transceiver configured\n"); 42 pr_err("HS USB OTG: no transceiver configured\n");
43 return -ENODEV; 43 return -ENODEV;
@@ -48,7 +48,7 @@ static int ux500_musb_init(struct musb *musb)
48 48
49static int ux500_musb_exit(struct musb *musb) 49static int ux500_musb_exit(struct musb *musb)
50{ 50{
51 otg_put_transceiver(musb->xceiv); 51 usb_put_transceiver(musb->xceiv);
52 52
53 return 0; 53 return 0;
54} 54}
@@ -58,7 +58,7 @@ static const struct musb_platform_ops ux500_ops = {
58 .exit = ux500_musb_exit, 58 .exit = ux500_musb_exit,
59}; 59};
60 60
61static int __init ux500_probe(struct platform_device *pdev) 61static int __devinit ux500_probe(struct platform_device *pdev)
62{ 62{
63 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 63 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
64 struct platform_device *musb; 64 struct platform_device *musb;
@@ -141,7 +141,7 @@ err0:
141 return ret; 141 return ret;
142} 142}
143 143
144static int __exit ux500_remove(struct platform_device *pdev) 144static int __devexit ux500_remove(struct platform_device *pdev)
145{ 145{
146 struct ux500_glue *glue = platform_get_drvdata(pdev); 146 struct ux500_glue *glue = platform_get_drvdata(pdev);
147 147
@@ -160,7 +160,7 @@ static int ux500_suspend(struct device *dev)
160 struct ux500_glue *glue = dev_get_drvdata(dev); 160 struct ux500_glue *glue = dev_get_drvdata(dev);
161 struct musb *musb = glue_to_musb(glue); 161 struct musb *musb = glue_to_musb(glue);
162 162
163 otg_set_suspend(musb->xceiv, 1); 163 usb_phy_set_suspend(musb->xceiv, 1);
164 clk_disable(glue->clk); 164 clk_disable(glue->clk);
165 165
166 return 0; 166 return 0;
@@ -178,7 +178,7 @@ static int ux500_resume(struct device *dev)
178 return ret; 178 return ret;
179 } 179 }
180 180
181 otg_set_suspend(musb->xceiv, 0); 181 usb_phy_set_suspend(musb->xceiv, 0);
182 182
183 return 0; 183 return 0;
184} 184}
@@ -194,7 +194,8 @@ static const struct dev_pm_ops ux500_pm_ops = {
194#endif 194#endif
195 195
196static struct platform_driver ux500_driver = { 196static struct platform_driver ux500_driver = {
197 .remove = __exit_p(ux500_remove), 197 .probe = ux500_probe,
198 .remove = __devexit_p(ux500_remove),
198 .driver = { 199 .driver = {
199 .name = "musb-ux500", 200 .name = "musb-ux500",
200 .pm = DEV_PM_OPS, 201 .pm = DEV_PM_OPS,
@@ -207,9 +208,9 @@ MODULE_LICENSE("GPL v2");
207 208
208static int __init ux500_init(void) 209static int __init ux500_init(void)
209{ 210{
210 return platform_driver_probe(&ux500_driver, ux500_probe); 211 return platform_driver_register(&ux500_driver);
211} 212}
212subsys_initcall(ux500_init); 213module_init(ux500_init);
213 214
214static void __exit ux500_exit(void) 215static void __exit ux500_exit(void)
215{ 216{