summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-omap3.c
diff options
context:
space:
mode:
authorKeshava Munegowda <Keshava_mgowda@ti.com>2011-10-11 13:22:11 +0530
committerPaul Walmsley <paul@pwsan.com>2011-12-16 04:29:57 -0700
commit6c984b066d84bb6e8f5a739ffb1dc4858df017a3 (patch)
treefd4212e8822cb1970326ffe4189e4e665eda5e5e /drivers/usb/host/ohci-omap3.c
parenta6d3a6622ee459eb44952246214d658b474ea8eb (diff)
downloadblackbird-op-linux-6c984b066d84bb6e8f5a739ffb1dc4858df017a3.tar.gz
blackbird-op-linux-6c984b066d84bb6e8f5a739ffb1dc4858df017a3.zip
ARM: OMAP: USBHOST: Replace usbhs core driver APIs by Runtime pm APIs
The ehci and ohci drivers does not use the APIs of the usbhs core driver; the runtime pm APIs are used for clock enable/disable. Since usbhs is parent platform device of the ehci and ohci devices, the runtime apis indirectly uses the usb hs core device as input parameter to for clock functions. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Reviewed-by: Partha Basak <parthab@india.ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'drivers/usb/host/ohci-omap3.c')
-rw-r--r--drivers/usb/host/ohci-omap3.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 516ebc4d6cc2..1b8133b6e451 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -31,6 +31,7 @@
#include <linux/platform_device.h>
#include <plat/usb.h>
+#include <linux/pm_runtime.h>
/*-------------------------------------------------------------------------*/
@@ -134,7 +135,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
int irq;
if (usb_disabled())
- goto err_end;
+ return -ENODEV;
if (!dev->parent) {
dev_err(dev, "Missing parent device\n");
@@ -172,11 +173,8 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
hcd->rsrc_len = resource_size(res);
hcd->regs = regs;
- ret = omap_usbhs_enable(dev);
- if (ret) {
- dev_dbg(dev, "failed to start ohci\n");
- goto err_end;
- }
+ pm_runtime_enable(dev);
+ pm_runtime_get_sync(dev);
ohci_hcd_init(hcd_to_ohci(hcd));
@@ -189,9 +187,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
return 0;
err_add_hcd:
- omap_usbhs_disable(dev);
-
-err_end:
+ pm_runtime_put_sync(dev);
usb_put_hcd(hcd);
err_io:
@@ -220,9 +216,9 @@ static int __devexit ohci_hcd_omap3_remove(struct platform_device *pdev)
iounmap(hcd->regs);
usb_remove_hcd(hcd);
- omap_usbhs_disable(dev);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
usb_put_hcd(hcd);
-
return 0;
}
OpenPOWER on IntegriCloud