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

Commit 42e2a0d4 authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam
Browse files

usb: phy: Clear the eud pet during probe



Boot software will pet the eud during boot-up as it turns on LDO24
irrespective of cable connection status. When boot up with USB cable
disconnected, clear the eud pet to avoid EUD safe mode timer
activation. Currently EUD is pet is set/cleared in dpdm regulator
callbacks which will not be invoked when target is booted with no
usb cable.

Change-Id: I8835d187b04ab1d42ac9f1e64a3d6a6bbba2ed89
Signed-off-by: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
parent cc8c86a2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1049,6 +1049,21 @@ static int qusb_phy_probe(struct platform_device *pdev)
	if (ret)
		return ret;

	/* ldo24 is turned on and eud is pet irrespective of cable
	 * cable connection status by boot sw. Assume usb cable is not
	 * connected and perform detach pet. If usb cable is connected,
	 * eud hw will be pet in the dpdm callback.
	 */
	if (qphy->eud_base) {
		if (qphy->cfg_ahb_clk)
			clk_prepare_enable(qphy->cfg_ahb_clk);

		writel_relaxed(0, qphy->eud_base + EUD_SW_ATTACH_DET);

		if (qphy->cfg_ahb_clk)
			clk_disable_unprepare(qphy->cfg_ahb_clk);
	}

	ret = qusb_phy_regulator_init(qphy);
	if (ret)
		usb_remove_phy(&qphy->phy);