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

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

Merge "power/usb: fix USB suspend requests from USB"

parents 88c22583 196df007
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2511,6 +2511,7 @@ static int get_prop_online(struct qpnp_chg_chip *chip)
	return qpnp_chg_is_batfet_closed(chip);
}

#define USB_SUSPEND_UA	2000
static void
qpnp_batt_external_power_changed(struct power_supply *psy)
{
@@ -2534,9 +2535,10 @@ qpnp_batt_external_power_changed(struct power_supply *psy)

		chip->prev_usb_max_ma = ret.intval;

		if (ret.intval <= 2 && !chip->use_default_batt_values &&
		if (ret.intval <= USB_SUSPEND_UA &&
					!chip->use_default_batt_values &&
					get_prop_batt_present(chip)) {
			if (ret.intval ==  2)
			if (ret.intval == USB_SUSPEND_UA)
				qpnp_chg_usb_suspend_enable(chip, 1);
			qpnp_chg_iusbmax_set(chip, QPNP_CHG_I_MAX_MIN_100);
		} else {
+2 −2
Original line number Diff line number Diff line
@@ -555,8 +555,8 @@ static int dwc3_otg_set_power(struct usb_phy *phy, unsigned mA)
		/* Disable charging */
		if (power_supply_set_online(dotg->psy, false))
			goto psy_error;
		/* Set max current limit */
		if (power_supply_set_current_limit(dotg->psy, 0))
		/* Set max current limit in uA */
		if (power_supply_set_current_limit(dotg->psy, 1000*mA))
			goto psy_error;
	}

+2 −2
Original line number Diff line number Diff line
@@ -1406,8 +1406,8 @@ static int msm_otg_notify_power_supply(struct msm_otg *motg, unsigned mA)
		/* Disable charging */
		if (power_supply_set_online(psy, false))
			goto psy_error;
		/* Set max current limit */
		if (power_supply_set_current_limit(psy, 0))
		/* Set max current limit in uA */
		if (power_supply_set_current_limit(psy, 1000*mA))
			goto psy_error;
	} else {
		if (power_supply_set_online(psy, true))