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

Commit 1ed58fac authored by Pratham Pratap's avatar Pratham Pratap
Browse files

usb: phy-msm-qusb-v2: Move qusb_phy_host_init to qusb_phy_init



Since notify_connect can be called from dwc3-msm driver and
hub driver, multiple phy initilizations is happening when HUB
is connected to the device.

Initialize qusb-phy for host mode in qusb_phy_init so that it
gets called only on core reset with HOST MODE FLAG set to
avoid multiple phy initialzations.

Change-Id: Iaa2a1dbedfd7968b8690847e4f219e205362c4a8
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent e3d045af
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -476,7 +476,6 @@ static void qusb_phy_host_init(struct usb_phy *phy)

	dev_dbg(phy->dev, "%s\n", __func__);

	qusb_phy_reset(qphy);
	qusb_phy_write_seq(qphy->base, qphy->qusb_phy_host_init_seq,
			qphy->host_init_seq_len, 0);

@@ -518,6 +517,12 @@ static int qusb_phy_init(struct usb_phy *phy)
	qusb_phy_enable_clocks(qphy, true);

	qusb_phy_reset(qphy);

	if (qphy->qusb_phy_host_init_seq && qphy->phy.flags & PHY_HOST_MODE) {
		qusb_phy_host_init(phy);
		return 0;
	}

	if (qphy->emulation) {
		if (qphy->emu_init_seq)
			qusb_phy_write_seq(qphy->emu_phy_base + 0x8000,
@@ -763,9 +768,6 @@ static int qusb_phy_notify_connect(struct usb_phy *phy,

	qphy->cable_connected = true;

	if (qphy->qusb_phy_host_init_seq && qphy->phy.flags & PHY_HOST_MODE)
		qusb_phy_host_init(phy);

	dev_dbg(phy->dev, "QUSB PHY: connect notification cable_connected=%d\n",
							qphy->cable_connected);
	return 0;