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

Commit 0bbe087b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: phy-msm: Don't allow multiple set_suspend() calls"

parents 4e1dee43 4d95e5c3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ struct msm_hsphy {
	struct regulator	*vdda33;
	struct regulator	*vdda18;
	int			vdd_levels[3]; /* none, low, high */
	bool			suspended;

	/* Using external VBUS/ID notification */
	bool			ext_vbus_id;
@@ -285,6 +286,12 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend)
	bool host = uphy->flags & PHY_HOST_MODE;
	bool chg_connected = uphy->flags & PHY_CHARGER_CONNECTED;

	if (!!suspend == phy->suspended) {
		dev_dbg(uphy->dev, "%s\n", suspend ? "already suspended"
						   : "already resumed");
		return 0;
	}

	if (suspend) {
		/* Clear interrupt latch register */
		writel_relaxed(ALT_INTERRUPT_MASK,
@@ -360,6 +367,7 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend)
		}
	}

	phy->suspended = !!suspend; /* double-NOT coerces to bool value */
	return 0;
}

@@ -477,6 +485,7 @@ static int msm_hsphy_probe(struct platform_device *pdev)

	phy->ext_vbus_id = of_property_read_bool(dev->of_node,
						"qcom,ext-vbus-id");
	phy->phy.dev = dev;

	phy->vdd = devm_regulator_get(dev, "vdd");
	if (IS_ERR(phy->vdd)) {
@@ -528,7 +537,6 @@ static int msm_hsphy_probe(struct platform_device *pdev)
	if (of_property_read_bool(dev->of_node, "qcom,vbus-valid-override"))
		phy->phy.flags |= PHY_VBUS_VALID_OVERRIDE;

	phy->phy.dev			= dev;
	phy->phy.init			= msm_hsphy_init;
	phy->phy.set_suspend		= msm_hsphy_set_suspend;
	phy->phy.notify_connect		= msm_hsphy_notify_connect;
+9 −1
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ struct msm_ssphy {
	void __iomem		*base;
	struct regulator	*vdd;
	struct regulator	*vdda18;
	bool			suspended;
	int			vdd_levels[3]; /* none, low, high */
	int			deemphasis_val;
};
@@ -304,6 +305,12 @@ static int msm_ssphy_set_suspend(struct usb_phy *uphy, int suspend)
	void __iomem *base = phy->base;
	int ret = 0;

	if (!!suspend == phy->suspended) {
		dev_dbg(uphy->dev, "%s\n", suspend ? "already suspended"
						   : "already resumed");
		return 0;
	}

	if (suspend) {
		/* Clear REF_SS_PHY_EN */
		msm_usb_write_readback(base, SS_PHY_CTRL_REG, REF_SS_PHY_EN, 0);
@@ -341,6 +348,7 @@ static int msm_ssphy_set_suspend(struct usb_phy *uphy, int suspend)
		msm_ssphy_set_params(uphy);
	}

	phy->suspended = !!suspend; /* double-NOT coerces to bool value */
	return ret;
}

@@ -407,6 +415,7 @@ static int msm_ssphy_probe(struct platform_device *pdev)
		return ret;
	}

	phy->phy.dev = dev;
	phy->vdd = devm_regulator_get(dev, "vdd");
	if (IS_ERR(phy->vdd)) {
		dev_err(dev, "unable to get vdd supply\n");
@@ -446,7 +455,6 @@ static int msm_ssphy_probe(struct platform_device *pdev)
						&phy->deemphasis_val))
		dev_dbg(dev, "unable to read ssphy deemphasis value\n");

	phy->phy.dev			= dev;
	phy->phy.init			= msm_ssphy_init;
	phy->phy.set_suspend		= msm_ssphy_set_suspend;
	phy->phy.set_params		= msm_ssphy_set_params;