diff options
Diffstat (limited to 'drivers/usb/musb/da8xx.c')
-rw-r--r-- | drivers/usb/musb/da8xx.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index e3486de71995..058775e647ad 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/platform_device.h> | 33 | #include <linux/platform_device.h> |
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | #include <linux/usb/usb_phy_gen_xceiv.h> | 35 | #include <linux/usb/usb_phy_generic.h> |
36 | 36 | ||
37 | #include <mach/da8xx.h> | 37 | #include <mach/da8xx.h> |
38 | #include <linux/platform_data/usb-davinci.h> | 38 | #include <linux/platform_data/usb-davinci.h> |
@@ -85,6 +85,7 @@ | |||
85 | struct da8xx_glue { | 85 | struct da8xx_glue { |
86 | struct device *dev; | 86 | struct device *dev; |
87 | struct platform_device *musb; | 87 | struct platform_device *musb; |
88 | struct platform_device *phy; | ||
88 | struct clk *clk; | 89 | struct clk *clk; |
89 | }; | 90 | }; |
90 | 91 | ||
@@ -418,7 +419,6 @@ static int da8xx_musb_init(struct musb *musb) | |||
418 | if (!rev) | 419 | if (!rev) |
419 | goto fail; | 420 | goto fail; |
420 | 421 | ||
421 | usb_nop_xceiv_register(); | ||
422 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); | 422 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); |
423 | if (IS_ERR_OR_NULL(musb->xceiv)) { | 423 | if (IS_ERR_OR_NULL(musb->xceiv)) { |
424 | ret = -EPROBE_DEFER; | 424 | ret = -EPROBE_DEFER; |
@@ -453,7 +453,6 @@ static int da8xx_musb_exit(struct musb *musb) | |||
453 | phy_off(); | 453 | phy_off(); |
454 | 454 | ||
455 | usb_put_phy(musb->xceiv); | 455 | usb_put_phy(musb->xceiv); |
456 | usb_nop_xceiv_unregister(); | ||
457 | 456 | ||
458 | return 0; | 457 | return 0; |
459 | } | 458 | } |
@@ -512,6 +511,11 @@ static int da8xx_probe(struct platform_device *pdev) | |||
512 | 511 | ||
513 | pdata->platform_ops = &da8xx_ops; | 512 | pdata->platform_ops = &da8xx_ops; |
514 | 513 | ||
514 | glue->phy = usb_phy_generic_register(); | ||
515 | if (IS_ERR(glue->phy)) { | ||
516 | ret = PTR_ERR(glue->phy); | ||
517 | goto err5; | ||
518 | } | ||
515 | platform_set_drvdata(pdev, glue); | 519 | platform_set_drvdata(pdev, glue); |
516 | 520 | ||
517 | memset(musb_resources, 0x00, sizeof(*musb_resources) * | 521 | memset(musb_resources, 0x00, sizeof(*musb_resources) * |
@@ -538,11 +542,14 @@ static int da8xx_probe(struct platform_device *pdev) | |||
538 | if (IS_ERR(musb)) { | 542 | if (IS_ERR(musb)) { |
539 | ret = PTR_ERR(musb); | 543 | ret = PTR_ERR(musb); |
540 | dev_err(&pdev->dev, "failed to register musb device: %d\n", ret); | 544 | dev_err(&pdev->dev, "failed to register musb device: %d\n", ret); |
541 | goto err5; | 545 | goto err6; |
542 | } | 546 | } |
543 | 547 | ||
544 | return 0; | 548 | return 0; |
545 | 549 | ||
550 | err6: | ||
551 | usb_phy_generic_unregister(glue->phy); | ||
552 | |||
546 | err5: | 553 | err5: |
547 | clk_disable(clk); | 554 | clk_disable(clk); |
548 | 555 | ||
@@ -561,6 +568,7 @@ static int da8xx_remove(struct platform_device *pdev) | |||
561 | struct da8xx_glue *glue = platform_get_drvdata(pdev); | 568 | struct da8xx_glue *glue = platform_get_drvdata(pdev); |
562 | 569 | ||
563 | platform_device_unregister(glue->musb); | 570 | platform_device_unregister(glue->musb); |
571 | usb_phy_generic_unregister(glue->phy); | ||
564 | clk_disable(glue->clk); | 572 | clk_disable(glue->clk); |
565 | clk_put(glue->clk); | 573 | clk_put(glue->clk); |
566 | kfree(glue); | 574 | kfree(glue); |