Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354696
b: refs/heads/master
c: 0c4c8bb
h: refs/heads/master
v: v3
  • Loading branch information
Kishon Vijay Abraham I authored and Felipe Balbi committed Jan 25, 2013
1 parent e888fdf commit fa45e76
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 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: b16604f2c1dc3f0a326818b282e6bb5f363f725e
refs/heads/master: 0c4c8bbbfdfc61c2ab2cc1026b5a05ae52396c93
28 changes: 27 additions & 1 deletion trunk/drivers/usb/phy/omap-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ static int omap_usb2_probe(struct platform_device *pdev)
}
clk_prepare(phy->wkupclk);

phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
if (IS_ERR(phy->optclk))
dev_vdbg(&pdev->dev, "unable to get refclk960m\n");
else
clk_prepare(phy->optclk);

usb_add_phy_dev(&phy->phy);

platform_set_drvdata(pdev, phy);
Expand All @@ -180,6 +186,8 @@ static int omap_usb2_remove(struct platform_device *pdev)
struct omap_usb *phy = platform_get_drvdata(pdev);

clk_unprepare(phy->wkupclk);
if (!IS_ERR(phy->optclk))
clk_unprepare(phy->optclk);
usb_remove_phy(&phy->phy);

return 0;
Expand All @@ -193,6 +201,8 @@ static int omap_usb2_runtime_suspend(struct device *dev)
struct omap_usb *phy = platform_get_drvdata(pdev);

clk_disable(phy->wkupclk);
if (!IS_ERR(phy->optclk))
clk_disable(phy->optclk);

return 0;
}
Expand All @@ -204,9 +214,25 @@ static int omap_usb2_runtime_resume(struct device *dev)
struct omap_usb *phy = platform_get_drvdata(pdev);

ret = clk_enable(phy->wkupclk);
if (ret < 0)
if (ret < 0) {
dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
goto err0;
}

if (!IS_ERR(phy->optclk)) {
ret = clk_enable(phy->optclk);
if (ret < 0) {
dev_err(phy->dev, "Failed to enable optclk %d\n", ret);
goto err1;
}
}

return 0;

err1:
clk_disable(phy->wkupclk);

err0:
return ret;
}

Expand Down

0 comments on commit fa45e76

Please sign in to comment.