Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1a4caf4 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Felipe Balbi
Browse files

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: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d0ee68b5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ static int msm_otg_phy_clk_reset(struct msm_otg *motg)
{
	int ret = 0;

	if (motg->pdata->phy_clk_reset && motg->phy_reset_clk)
	if (motg->pdata->phy_clk_reset)
		ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
	else if (motg->phy_rst)
		ret = reset_control_reset(motg->phy_rst);
@@ -1554,11 +1554,14 @@ static int msm_otg_probe(struct platform_device *pdev)
	phy = &motg->phy;
	phy->dev = &pdev->dev;

	if (motg->pdata->phy_clk_reset) {
		motg->phy_reset_clk = devm_clk_get(&pdev->dev,
					   np ? "phy" : "usb_phy_clk");

		if (IS_ERR(motg->phy_reset_clk)) {
			dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
		motg->phy_reset_clk = NULL;
			return PTR_ERR(motg->phy_reset_clk);
		}
	}

	motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");