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

Commit 5f5def1a authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: phy-msm-ssusb-qmp: Improve msm_ssphy_qmp_powerup API



Workaround implemneted by commit <8182accd> ("usb: dwc3:
Powerdown the SS PHY while connected to HS device") needs to
be applied and removed when PHY_WAKEUP_WA_EN flag is set.
This allows the API call to become no-op if workaround is
not required in case super speed port is enabled.

Change-Id: I5e4784a1b5af72f6d85d0c6e94ebc717807c655d
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 18d33652
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3795,6 +3795,7 @@ static int dwc3_msm_host_notifier(struct notifier_block *nb,
				 * ss phy to avoid turning on pipe clock during
				 * these wake-ups.
				 */
				mdwc->ss_phy->flags |= PHY_WAKEUP_WA_EN;
				usb_phy_powerdown(mdwc->ss_phy);

				/*
@@ -3813,6 +3814,7 @@ static int dwc3_msm_host_notifier(struct notifier_block *nb,
			}
		} else {
			usb_phy_powerup(mdwc->ss_phy);
			mdwc->ss_phy->flags &= ~PHY_WAKEUP_WA_EN;
			/* set rate back to default core clk rate */
			clk_set_rate(mdwc->core_clk, mdwc->core_clk_rate);
			dev_dbg(mdwc->dev, "set core clk rate %ld\n",
+9 −0
Original line number Diff line number Diff line
@@ -853,6 +853,15 @@ static int msm_ssphy_qmp_powerup(struct usb_phy *uphy, bool powerup)
	u8 reg = powerup ? 1 : 0;
	u8 temp;

	if (!(uphy->flags & PHY_WAKEUP_WA_EN))
		return 0;

	temp = readl_relaxed(phy->base +
			phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);

	if (temp == powerup)
		return 0;

	writel_relaxed(reg,
			phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
	temp = readl_relaxed(phy->base +
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#define PHY_HSFS_MODE		BIT(8)
#define PHY_LS_MODE		BIT(9)
#define PHY_USB_DP_CONCURRENT_MODE	BIT(10)
#define PHY_WAKEUP_WA_EN	BIT(11)

enum usb_phy_interface {
	USBPHY_INTERFACE_MODE_UNKNOWN,