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

Commit cbb6f3ae authored by Zhenhua Huang's avatar Zhenhua Huang
Browse files

power: qpnp-charger: fix power stage work around



For power stage work around, it uses prev_usb_max_ma
as the judgement for whether need reduce power stage.
We should guarantee this variable be initialized before
reduce power stage work around scheduled.

Change-Id: Ide00b540a0a26e5593a9b924fbd329c4ca9b20f6
Signed-off-by: default avatarZhenhua Huang <zhenhuah@codeaurora.org>
parent 7182485d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2130,6 +2130,8 @@ qpnp_batt_external_power_changed(struct power_supply *psy)
		if (chip->prev_usb_max_ma == ret.intval)
			goto skip_set_iusb_max;

		chip->prev_usb_max_ma = ret.intval;

		if (ret.intval <= 2 && !chip->use_default_batt_values &&
						get_prop_batt_present(chip)) {
			qpnp_chg_usb_suspend_enable(chip, 1);
@@ -2158,7 +2160,6 @@ qpnp_batt_external_power_changed(struct power_supply *psy)
				schedule_work(&chip->reduce_power_stage_work);
			}
		}
		chip->prev_usb_max_ma = ret.intval;
	}

skip_set_iusb_max: