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

Commit 4cc94c33 authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: qusb: Do not disable PHY resources upon spoof disconnect



The PMIC firmware is no more enabling the resources required
for the PHY for the EUD usecase.
So, if the required resources for the PHY are turned off
as part of spoof disconnect the EUD fails to work.
Fix this by keeping the PHY resources enabled as part
of spoof disconnect.

Change-Id: I2ee734eec0c78b062d2e0726e9efa5a88db8c02d
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent e117350b
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -640,11 +640,22 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
	u32 linestate = 0, intr_mask = 0;

	if (qphy->suspended == suspend) {
		/*
		 * PHY_SUS_OVERRIDE is set when there is a cable
		 * disconnect and the previous suspend call was because
		 * of EUD spoof disconnect. Override this check and
		 * ensure that the PHY is properly put in low power
		 * mode.
		 */
		if (qphy->phy.flags & PHY_SUS_OVERRIDE)
			goto suspend;

		dev_dbg(phy->dev, "%s: USB PHY is already suspended\n",
			__func__);
		return 0;
	}

suspend:
	if (suspend) {
		/* Bus suspend case */
		if (qphy->cable_connected) {
@@ -697,8 +708,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
			writel_relaxed(0x00,
				qphy->base + QUSB2PHY_PORT_INTR_CTRL);

			if (!qphy->eud_enable_reg ||
					!readl_relaxed(qphy->eud_enable_reg)) {
			if (!(qphy->phy.flags & EUD_SPOOF_DISCONNECT)) {
				/* Disable PHY */
				writel_relaxed(POWER_DOWN |
					readl_relaxed(qphy->base +
@@ -710,10 +720,11 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
				if (qphy->tcsr_clamp_dig_n)
					writel_relaxed(0x0,
						qphy->tcsr_clamp_dig_n);
			}

				qusb_phy_enable_clocks(qphy, false);
				qusb_phy_enable_power(qphy, false);
			}

			mutex_unlock(&qphy->phy_lock);

			/*