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

Commit 0aa232e0 authored by Jack Pham's avatar Jack Pham Committed by Zhoulu Luo
Browse files

usb: phy: qmp: Add support for SS_PHY LDO clock



The SS_PHY_LDO is a signal that controls the buffer that
receiving the external reference clock. This signal is
provided by the clock driver and should be enabled once
by the QMP PHY driver upon bootup.

Change-Id: Ibe1b7a8f6d8830e113a2f1ce69abe330bc0d417b
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 006e5fe9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ struct msm_ssphy_qmp {
	struct regulator	*vdd;
	struct regulator	*vdda18;
	int			vdd_levels[3]; /* none, low, high */
	struct clk		*ldo_clk;
	struct clk		*aux_clk;
	struct clk		*cfg_ahb_clk;
	struct clk		*pipe_clk;
@@ -690,6 +691,10 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev)
		goto disable_ss_vdd;
	}

	phy->ldo_clk = devm_clk_get(dev, "ldo_clk");
	if (!IS_ERR(phy->ldo_clk))
		clk_prepare_enable(phy->ldo_clk);

	platform_set_drvdata(pdev, phy);

	if (of_property_read_bool(dev->of_node, "qcom,vbus-valid-override"))
@@ -718,6 +723,8 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev)
	return 0;

disable_ss_ldo:
	if (!IS_ERR(phy->ldo_clk))
		clk_disable_unprepare(phy->ldo_clk);
	msm_ssusb_qmp_ldo_enable(phy, 0);
disable_ss_vdd:
	regulator_disable(phy->vdd);
@@ -735,6 +742,8 @@ static int msm_ssphy_qmp_remove(struct platform_device *pdev)
		return 0;

	usb_remove_phy(&phy->phy);
	if (!IS_ERR(phy->ldo_clk))
		clk_disable_unprepare(phy->ldo_clk);
	msm_ssusb_qmp_ldo_enable(phy, 0);
	regulator_disable(phy->vdd);
	msm_ssusb_qmp_config_vdd(phy, 0);