diff options
Diffstat (limited to 'drivers/usb/musb/am35x.c')
-rw-r--r-- | drivers/usb/musb/am35x.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index b3aa0184af9a..0a34dd859555 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.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 | #include <linux/platform_data/usb-omap.h> | 36 | #include <linux/platform_data/usb-omap.h> |
37 | 37 | ||
38 | #include "musb_core.h" | 38 | #include "musb_core.h" |
@@ -85,6 +85,7 @@ | |||
85 | struct am35x_glue { | 85 | struct am35x_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 *phy_clk; | 89 | struct clk *phy_clk; |
89 | struct clk *clk; | 90 | struct clk *clk; |
90 | }; | 91 | }; |
@@ -360,7 +361,6 @@ static int am35x_musb_init(struct musb *musb) | |||
360 | if (!rev) | 361 | if (!rev) |
361 | return -ENODEV; | 362 | return -ENODEV; |
362 | 363 | ||
363 | usb_nop_xceiv_register(); | ||
364 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); | 364 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); |
365 | if (IS_ERR_OR_NULL(musb->xceiv)) | 365 | if (IS_ERR_OR_NULL(musb->xceiv)) |
366 | return -EPROBE_DEFER; | 366 | return -EPROBE_DEFER; |
@@ -402,7 +402,6 @@ static int am35x_musb_exit(struct musb *musb) | |||
402 | data->set_phy_power(0); | 402 | data->set_phy_power(0); |
403 | 403 | ||
404 | usb_put_phy(musb->xceiv); | 404 | usb_put_phy(musb->xceiv); |
405 | usb_nop_xceiv_unregister(); | ||
406 | 405 | ||
407 | return 0; | 406 | return 0; |
408 | } | 407 | } |
@@ -505,6 +504,9 @@ static int am35x_probe(struct platform_device *pdev) | |||
505 | 504 | ||
506 | pdata->platform_ops = &am35x_ops; | 505 | pdata->platform_ops = &am35x_ops; |
507 | 506 | ||
507 | glue->phy = usb_phy_generic_register(); | ||
508 | if (IS_ERR(glue->phy)) | ||
509 | goto err7; | ||
508 | platform_set_drvdata(pdev, glue); | 510 | platform_set_drvdata(pdev, glue); |
509 | 511 | ||
510 | pinfo = am35x_dev_info; | 512 | pinfo = am35x_dev_info; |
@@ -518,11 +520,14 @@ static int am35x_probe(struct platform_device *pdev) | |||
518 | if (IS_ERR(musb)) { | 520 | if (IS_ERR(musb)) { |
519 | ret = PTR_ERR(musb); | 521 | ret = PTR_ERR(musb); |
520 | dev_err(&pdev->dev, "failed to register musb device: %d\n", ret); | 522 | dev_err(&pdev->dev, "failed to register musb device: %d\n", ret); |
521 | goto err7; | 523 | goto err8; |
522 | } | 524 | } |
523 | 525 | ||
524 | return 0; | 526 | return 0; |
525 | 527 | ||
528 | err8: | ||
529 | usb_phy_generic_unregister(glue->phy); | ||
530 | |||
526 | err7: | 531 | err7: |
527 | clk_disable(clk); | 532 | clk_disable(clk); |
528 | 533 | ||
@@ -547,6 +552,7 @@ static int am35x_remove(struct platform_device *pdev) | |||
547 | struct am35x_glue *glue = platform_get_drvdata(pdev); | 552 | struct am35x_glue *glue = platform_get_drvdata(pdev); |
548 | 553 | ||
549 | platform_device_unregister(glue->musb); | 554 | platform_device_unregister(glue->musb); |
555 | usb_phy_generic_unregister(glue->phy); | ||
550 | clk_disable(glue->clk); | 556 | clk_disable(glue->clk); |
551 | clk_disable(glue->phy_clk); | 557 | clk_disable(glue->phy_clk); |
552 | clk_put(glue->clk); | 558 | clk_put(glue->clk); |