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

Commit ef3c7d92 authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: phy: Add module parameter for eud connected case



Currently phy driver cannot distinguish between physical
and spoof disconnect. For EUD to work after spoof disconnect
driver should not power down the phy and deassert TCSR
register. So this change adds module parameter to distinguish
between spoof disconnect and physical disconnect. As a part of
EUD enablement user should set this parameter as true.

Change-Id: Ibe11173ba6c79043cc8eefb45092d6900e2913ce
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 1498ee33
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ static unsigned int tune5;
module_param(tune5, uint, 0644);
MODULE_PARM_DESC(tune5, "QUSB PHY TUNE5");

static bool eud_connected;
module_param(eud_connected, bool, 0644);
MODULE_PARM_DESC(eud_connected, "EUD_CONNECTED");

struct qusb_phy {
	struct usb_phy		phy;
@@ -704,6 +707,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
			writel_relaxed(0x00,
				qphy->base + QUSB2PHY_PORT_INTR_CTRL);

			if (!eud_connected) {
				/* Disable PHY */
				writel_relaxed(POWER_DOWN |
					readl_relaxed(qphy->base +
@@ -712,10 +716,12 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
				/* Make sure that above write is completed */
				wmb();

			qusb_phy_enable_clocks(qphy, false);
				if (qphy->tcsr_clamp_dig_n)
					writel_relaxed(0x0,
						qphy->tcsr_clamp_dig_n);
			}

			qusb_phy_enable_clocks(qphy, false);
			/* Do not disable power rails if there is vote for it */
			if (!qphy->dpdm_enable)
				qusb_phy_enable_power(qphy, false);