Commit a1a4caf41ed8154c4e7b75b4e12c1a7d851e2137

Authored by Srinivas Kandagatla
Committed by Felipe Balbi
1 parent d0ee68b59e

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>

Showing 1 changed file with 8 additions and 5 deletions Side-by-side Diff

drivers/usb/phy/phy-msm-usb.c
... ... @@ -281,7 +281,7 @@
281 281 {
282 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 285 ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
286 286 else if (motg->phy_rst)
287 287 ret = reset_control_reset(motg->phy_rst);
288 288  
... ... @@ -1554,11 +1554,14 @@
1554 1554 phy = &motg->phy;
1555 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 1559 np ? "phy" : "usb_phy_clk");
1559   - if (IS_ERR(motg->phy_reset_clk)) {
1560   - dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
1561   - motg->phy_reset_clk = NULL;
  1560 +
  1561 + if (IS_ERR(motg->phy_reset_clk)) {
  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 1567 motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");