Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281820
b: refs/heads/master
c: 6c984b0
h: refs/heads/master
v: v3
  • Loading branch information
Keshava Munegowda authored and Paul Walmsley committed Dec 16, 2011
1 parent ec079c0 commit 20597f3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6d3a6622ee459eb44952246214d658b474ea8eb
refs/heads/master: 6c984b066d84bb6e8f5a739ffb1dc4858df017a3
3 changes: 0 additions & 3 deletions trunk/arch/arm/plat-omap/include/plat/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ extern void usb_musb_init(struct omap_musb_board_data *board_data);

extern void usbhs_init(const struct usbhs_omap_board_data *pdata);

extern int omap_usbhs_enable(struct device *dev);
extern void omap_usbhs_disable(struct device *dev);

extern int omap4430_phy_power(struct device *dev, int ID, int on);
extern int omap4430_phy_set_clk(struct device *dev, int on);
extern int omap4430_phy_init(struct device *dev);
Expand Down
17 changes: 7 additions & 10 deletions trunk/drivers/usb/host/ehci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -240,11 +238,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);
Expand All @@ -266,10 +261,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;
}

Expand Down
18 changes: 7 additions & 11 deletions trunk/drivers/usb/host/ohci-omap3.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <linux/platform_device.h>
#include <plat/usb.h>
#include <linux/pm_runtime.h>

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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));

Expand All @@ -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:
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 20597f3

Please sign in to comment.