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

Commit 1a9d4c37 authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: phy: Make ref_clk optional for driver probe success



Ref_clk is needed only in case of differential clock. There
are cases in which ref_clk is coming directy from CXO pad
and connected to a differential pin. In this case ref_clk
will not be passed from DT node and driver must success its
probe. So this change makes ref_clk optional for successful
completion of probe.

Change-Id: I80a293e381b69306eeca916da36edba06a3879b6
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 5457aada
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -1016,11 +1016,20 @@ static int qusb_phy_probe(struct platform_device *pdev)
	if (IS_ERR(qphy->ref_clk_src))
		dev_dbg(dev, "clk get failed for ref_clk_src\n");

	/* ref_clk is needed only for DIFF_CLK case, hence make it optional. */
	if (of_property_match_string(pdev->dev.of_node,
				"clock-names", "ref_clk") >= 0) {
		qphy->ref_clk = devm_clk_get(dev, "ref_clk");
	if (IS_ERR(qphy->ref_clk))
		dev_dbg(dev, "clk get failed for ref_clk\n");
	else
		if (IS_ERR(qphy->ref_clk)) {
			ret = PTR_ERR(qphy->ref_clk);
			if (ret != -EPROBE_DEFER)
				dev_dbg(dev,
					"clk get failed for ref_clk\n");
			return ret;
		}

		clk_set_rate(qphy->ref_clk, 19200000);
	}

	qphy->cfg_ahb_clk = devm_clk_get(dev, "cfg_ahb_clk");
	if (IS_ERR(qphy->cfg_ahb_clk))