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

Commit 1c603d13 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-hsusb: Allow VDD MIN when DCP charger is connected"

parents c64c66b1 eb7e0fbb
Loading
Loading
Loading
Loading
+19 −10
Original line number Diff line number Diff line
@@ -490,12 +490,17 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend)
		}

		/* can turn off regulators if disconnected in device mode */
		if (phy->lpm_flags & PHY_RETENTIONED && !phy->cable_connected) {
			if (phy->ext_vbus_id) {
		if (phy->lpm_flags & PHY_RETENTIONED && !phy->cable_connected
				&& phy->ext_vbus_id) {
			msm_hsusb_ldo_enable(phy, 0);
			phy->lpm_flags |= PHY_PWR_COLLAPSED;
		}

		/* Minimize VDD if charger is connected */
		if ((phy->lpm_flags & PHY_RETENTIONED && !phy->cable_connected)
				|| chg_connected) {
			msm_hsusb_config_vdd(phy, 0);
			phy->lpm_flags |= PHY_VDD_MINIMIZED;
		}

		count = atomic_dec_return(&hsphy_active_count);
@@ -506,13 +511,17 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend)
		}
	} else {
		atomic_inc(&hsphy_active_count);
		if (phy->lpm_flags & PHY_RETENTIONED && !phy->cable_connected) {
		if (phy->lpm_flags & PHY_VDD_MINIMIZED) {
			msm_hsusb_config_vdd(phy, 1);
			if (phy->ext_vbus_id) {
			phy->lpm_flags &= ~PHY_VDD_MINIMIZED;
		}

		if (phy->lpm_flags & PHY_PWR_COLLAPSED) {
			msm_hsusb_ldo_enable(phy, 1);
			phy->lpm_flags &= ~PHY_PWR_COLLAPSED;
		}

		if (phy->lpm_flags & PHY_RETENTIONED) {
			if (phy->csr) {
				/* power on PHY */
				msm_usb_write_readback(phy->csr,
+2 −1
Original line number Diff line number Diff line
@@ -525,6 +525,7 @@ struct msm_otg {
#define XO_SHUTDOWN			BIT(2)
#define CLOCKS_DOWN			BIT(3)
#define PHY_REGULATORS_LPM		BIT(4)
#define PHY_VDD_MINIMIZED		BIT(5)
	int reset_counter;
	unsigned long b_last_se0_sess;
	unsigned long tmouts;