aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2014-08-21 02:45:10 -0400
committerFelipe Balbi <balbi@ti.com>2014-08-27 15:13:17 -0400
commita1a4caf41ed8154c4e7b75b4e12c1a7d851e2137 (patch)
treeb01a1bd9145d8db5f37ea7795e389697c4943fd5 /drivers/usb/phy
parentd0ee68b59e6aa33221445dc555efac3736b89026 (diff)
usb: phy: msm: Make phy_reset clk and reset line optional.
This patch makes the phy reset clk and reset line optional as this clk is not available on boards like IFC6410 with APQ8064. phy-reset clk is only used as argument to the mach level callbacks, so this patch adds condition before clk_get calls so that the driver wouldn't fail on SOCs which do not have this support. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-msm-usb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index df8e1ba56509..45b95946500f 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -281,7 +281,7 @@ static int msm_otg_phy_clk_reset(struct msm_otg *motg)
281{ 281{
282 int ret = 0; 282 int ret = 0;
283 283
284 if (motg->pdata->phy_clk_reset && motg->phy_reset_clk) 284 if (motg->pdata->phy_clk_reset)
285 ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk); 285 ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
286 else if (motg->phy_rst) 286 else if (motg->phy_rst)
287 ret = reset_control_reset(motg->phy_rst); 287 ret = reset_control_reset(motg->phy_rst);
@@ -1554,11 +1554,14 @@ static int msm_otg_probe(struct platform_device *pdev)
1554 phy = &motg->phy; 1554 phy = &motg->phy;
1555 phy->dev = &pdev->dev; 1555 phy->dev = &pdev->dev;
1556 1556
1557 motg->phy_reset_clk = devm_clk_get(&pdev->dev, 1557 if (motg->pdata->phy_clk_reset) {
1558 motg->phy_reset_clk = devm_clk_get(&pdev->dev,
1558 np ? "phy" : "usb_phy_clk"); 1559 np ? "phy" : "usb_phy_clk");
1559 if (IS_ERR(motg->phy_reset_clk)) { 1560
1560 dev_err(&pdev->dev, "failed to get usb_phy_clk\n"); 1561 if (IS_ERR(motg->phy_reset_clk)) {
1561 motg->phy_reset_clk = NULL; 1562 dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
1563 return PTR_ERR(motg->phy_reset_clk);
1564 }
1562 } 1565 }
1563 1566
1564 motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk"); 1567 motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");