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

Commit 8a6be563 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: Remove phy_com_reset clock"

parents dab0d727 0a57adc1
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -173,7 +173,6 @@ struct dwc3_msm {
	struct clk		*iface_clk;
	struct clk		*sleep_clk;
	struct clk		*utmi_clk;
	struct clk		*phy_com_reset;
	unsigned int		utmi_clk_rate;
	struct clk		*utmi_clk_src;
	struct clk		*bus_aggr_clk;
@@ -1563,14 +1562,10 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc)
		dev_dbg(mdwc->dev, "%s: exit power collapse\n", __func__);
		dwc3_msm_config_gdsc(mdwc, 1);

		if (mdwc->phy_com_reset)
			clk_reset(mdwc->phy_com_reset, CLK_RESET_ASSERT);
		clk_reset(mdwc->core_clk, CLK_RESET_ASSERT);
		/* HW requires a short delay for reset to take place properly */
		usleep_range(1000, 1200);
		clk_reset(mdwc->core_clk, CLK_RESET_DEASSERT);
		if (mdwc->phy_com_reset)
			clk_reset(mdwc->phy_com_reset, CLK_RESET_DEASSERT);
	}


@@ -2430,20 +2425,6 @@ static int dwc3_msm_probe(struct platform_device *pdev)
		mdwc->lpm_to_suspend_delay = 0;
	}

	if (mdwc->power_collapse) {
		/*
		 * If present, the phy_com_reset is used in conjunction
		 * with power collapse exit
		 */
		mdwc->phy_com_reset = devm_clk_get(&pdev->dev, "phy_com_reset");
		if (IS_ERR(mdwc->phy_com_reset)) {
			dev_dbg(&pdev->dev,
				"%s unable to get phy_com_reset clock, ret=%ld\n",
				__func__, PTR_ERR(mdwc->phy_com_reset));
			mdwc->phy_com_reset = NULL;
		}
	}

	/*
	 * DWC3 has separate IRQ line for OTG events (ID/BSV) and for
	 * DP and DM linestate transitions during low power mode.
+5 −37
Original line number Diff line number Diff line
@@ -342,7 +342,6 @@ struct msm_ssphy_qmp {
	struct clk		*aux_clk;
	struct clk		*cfg_ahb_clk;
	struct clk		*pipe_clk;
	struct clk		*phy_com_reset;
	struct clk		*phy_reset;
	struct clk		*phy_phy_reset;
	bool			clk_enabled;
@@ -634,27 +633,18 @@ static int msm_ssphy_qmp_reset(struct usb_phy *uphy)

	dev_dbg(uphy->dev, "Resetting QMP phy\n");

	/* Assert USB3 PHY reset */
	if (phy->phy_com_reset) {
		ret = clk_reset(phy->phy_com_reset, CLK_RESET_ASSERT);
		if (ret) {
			dev_err(uphy->dev, "phy_com_reset clk assert failed\n");
			return ret;
		}
	}

	/* Assert USB3 PHY reset */
	if (phy->phy_phy_reset) {
		ret = clk_reset(phy->phy_phy_reset, CLK_RESET_ASSERT);
		if (ret) {
			dev_err(uphy->dev, "phy_phy reset assert failed\n");
			goto deassert_phy_com_reset;
			goto exit;
		}
	} else {
		ret = clk_reset(phy->pipe_clk, CLK_RESET_ASSERT);
		if (ret) {
			dev_err(uphy->dev, "pipe_clk reset assert failed\n");
			goto deassert_phy_com_reset;
			goto exit;
		}
	}

@@ -677,23 +667,16 @@ static int msm_ssphy_qmp_reset(struct usb_phy *uphy)
		ret = clk_reset(phy->phy_phy_reset, CLK_RESET_DEASSERT);
		if (ret) {
			dev_err(uphy->dev, "phy_phy reset deassert failed\n");
			goto deassert_phy_com_reset;
			goto exit;
		}
	} else {
		ret = clk_reset(phy->pipe_clk, CLK_RESET_DEASSERT);
		if (ret) {
			dev_err(uphy->dev, "pipe_clk reset deassert failed\n");
			goto deassert_phy_com_reset;
			goto exit;
		}
	}

	if (phy->phy_com_reset) {
		ret = clk_reset(phy->phy_com_reset, CLK_RESET_DEASSERT);
		if (ret) {
			dev_err(uphy->dev, "phy_com_reset clk deassert failed\n");
			return ret;
		}
	}
	return 0;

deassert_phy_phy_reset:
@@ -701,10 +684,7 @@ deassert_phy_phy_reset:
		clk_reset(phy->phy_phy_reset, CLK_RESET_DEASSERT);
	else
		clk_reset(phy->pipe_clk, CLK_RESET_DEASSERT);
deassert_phy_com_reset:
	if (phy->phy_com_reset)
		clk_reset(phy->phy_com_reset, CLK_RESET_DEASSERT);

exit:
	phy->in_suspend = false;

	return ret;
@@ -871,18 +851,6 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev)
		goto err;
	}

	if (of_property_match_string(pdev->dev.of_node,
				"clock-names", "phy_com_reset") >= 0) {
		phy->phy_com_reset = clk_get(&pdev->dev,
							"phy_com_reset");
		if (IS_ERR(phy->phy_com_reset)) {
			ret = PTR_ERR(phy->phy_com_reset);
			phy->phy_com_reset = NULL;
			dev_dbg(dev, "failed to get phy_com_reset\n");
			goto err;
		}
	}

	if (of_property_match_string(pdev->dev.of_node,
				"clock-names", "phy_reset") >= 0) {
		phy->phy_reset = clk_get(&pdev->dev, "phy_reset");