]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/host/ehci-omap.c
USB: EHCI: Don't use NO_IRQ in xilinx ehci driver
[~andy/linux] / drivers / usb / host / ehci-omap.c
index e39b0297bad1806a2e2cb49e2a5047e026847dc6..bba9850f32f09f78c668a04d2d024d99d3320857 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/usb/ulpi.h>
 #include <plat/usb.h>
 #include <linux/regulator/consumer.h>
+#include <linux/pm_runtime.h>
 
 /* EHCI Register Set */
 #define EHCI_INSNREG04                                 (0xA0)
@@ -190,11 +191,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
                }
        }
 
-       ret = omap_usbhs_enable(dev);
-       if (ret) {
-               dev_err(dev, "failed to start usbhs with err %d\n", ret);
-               goto err_enable;
-       }
+       pm_runtime_enable(dev);
+       pm_runtime_get_sync(dev);
 
        /*
         * An undocumented "feature" in the OMAP3 EHCI controller,
@@ -228,6 +226,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
        /* cache this readonly data; minimize chip reads */
        omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params);
 
+       ehci_reset(omap_ehci);
+
        ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (ret) {
                dev_err(dev, "failed to add hcd with err %d\n", ret);
@@ -240,11 +240,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
        return 0;
 
 err_add_hcd:
-       omap_usbhs_disable(dev);
-
-err_enable:
        disable_put_regulator(pdata);
-       usb_put_hcd(hcd);
+       pm_runtime_put_sync(dev);
 
 err_io:
        iounmap(regs);
@@ -266,10 +263,12 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
        struct usb_hcd *hcd     = dev_get_drvdata(dev);
 
        usb_remove_hcd(hcd);
-       omap_usbhs_disable(dev);
        disable_put_regulator(dev->platform_data);
        iounmap(hcd->regs);
        usb_put_hcd(hcd);
+       pm_runtime_put_sync(dev);
+       pm_runtime_disable(dev);
+
        return 0;
 }