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

Commit 0a57adc1 authored by Azhar Shaikh's avatar Azhar Shaikh
Browse files

usb: Remove phy_com_reset clock



Newer targets do not have the phy_com_reset clock.
Hence remove all its instances from controller and phy drivers.

Change-Id: I092ae3f4570e5df84a1c93fff701fa1bf086837c
Signed-off-by: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent 37bc52a5
Loading
Loading
Loading
Loading
+0 −19
Original line number Original line Diff line number Diff line
@@ -173,7 +173,6 @@ struct dwc3_msm {
	struct clk		*iface_clk;
	struct clk		*iface_clk;
	struct clk		*sleep_clk;
	struct clk		*sleep_clk;
	struct clk		*utmi_clk;
	struct clk		*utmi_clk;
	struct clk		*phy_com_reset;
	unsigned int		utmi_clk_rate;
	unsigned int		utmi_clk_rate;
	struct clk		*utmi_clk_src;
	struct clk		*utmi_clk_src;
	struct clk		*bus_aggr_clk;
	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__);
		dev_dbg(mdwc->dev, "%s: exit power collapse\n", __func__);
		dwc3_msm_config_gdsc(mdwc, 1);
		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);
		clk_reset(mdwc->core_clk, CLK_RESET_ASSERT);
		/* HW requires a short delay for reset to take place properly */
		/* HW requires a short delay for reset to take place properly */
		usleep_range(1000, 1200);
		usleep_range(1000, 1200);
		clk_reset(mdwc->core_clk, CLK_RESET_DEASSERT);
		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;
		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
	 * DWC3 has separate IRQ line for OTG events (ID/BSV) and for
	 * DP and DM linestate transitions during low power mode.
	 * DP and DM linestate transitions during low power mode.
+5 −37
Original line number Original line Diff line number Diff line
@@ -342,7 +342,6 @@ struct msm_ssphy_qmp {
	struct clk		*aux_clk;
	struct clk		*aux_clk;
	struct clk		*cfg_ahb_clk;
	struct clk		*cfg_ahb_clk;
	struct clk		*pipe_clk;
	struct clk		*pipe_clk;
	struct clk		*phy_com_reset;
	struct clk		*phy_reset;
	struct clk		*phy_reset;
	struct clk		*phy_phy_reset;
	struct clk		*phy_phy_reset;
	bool			clk_enabled;
	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");
	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 */
	/* Assert USB3 PHY reset */
	if (phy->phy_phy_reset) {
	if (phy->phy_phy_reset) {
		ret = clk_reset(phy->phy_phy_reset, CLK_RESET_ASSERT);
		ret = clk_reset(phy->phy_phy_reset, CLK_RESET_ASSERT);
		if (ret) {
		if (ret) {
			dev_err(uphy->dev, "phy_phy reset assert failed\n");
			dev_err(uphy->dev, "phy_phy reset assert failed\n");
			goto deassert_phy_com_reset;
			goto exit;
		}
		}
	} else {
	} else {
		ret = clk_reset(phy->pipe_clk, CLK_RESET_ASSERT);
		ret = clk_reset(phy->pipe_clk, CLK_RESET_ASSERT);
		if (ret) {
		if (ret) {
			dev_err(uphy->dev, "pipe_clk reset assert failed\n");
			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);
		ret = clk_reset(phy->phy_phy_reset, CLK_RESET_DEASSERT);
		if (ret) {
		if (ret) {
			dev_err(uphy->dev, "phy_phy reset deassert failed\n");
			dev_err(uphy->dev, "phy_phy reset deassert failed\n");
			goto deassert_phy_com_reset;
			goto exit;
		}
		}
	} else {
	} else {
		ret = clk_reset(phy->pipe_clk, CLK_RESET_DEASSERT);
		ret = clk_reset(phy->pipe_clk, CLK_RESET_DEASSERT);
		if (ret) {
		if (ret) {
			dev_err(uphy->dev, "pipe_clk reset deassert failed\n");
			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;
	return 0;


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

	phy->in_suspend = false;
	phy->in_suspend = false;


	return ret;
	return ret;
@@ -871,18 +851,6 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev)
		goto err;
		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,
	if (of_property_match_string(pdev->dev.of_node,
				"clock-names", "phy_reset") >= 0) {
				"clock-names", "phy_reset") >= 0) {
		phy->phy_reset = clk_get(&pdev->dev, "phy_reset");
		phy->phy_reset = clk_get(&pdev->dev, "phy_reset");