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

Commit 4028ab2c authored by Devesh Jhunjhunwala's avatar Devesh Jhunjhunwala
Browse files

power: qpnp-smbcharger: Update get_prop_batt_status method



Since the hvdcp 3 detection sequence fakes disconnecting and
reconnecting the usb, this makes it look like the battery
charging status is glitching. So update the get_batt_prop_status
method to return CHARGING if the hvdcp_3_det_ignore_uv flag is
set.

CRs-Fixed: 899401
Change-Id: I675e5c14286fe376ef4ff747b2fc746e149513c4
Signed-off-by: default avatarDevesh Jhunjhunwala <deveshj@codeaurora.org>
parent 8ae65e26
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -758,7 +758,8 @@ static int get_prop_batt_status(struct smbchg_chip *chip)
	u8 reg = 0, chg_type;
	bool charger_present, chg_inhibit;

	charger_present = is_usb_present(chip) | is_dc_present(chip);
	charger_present = is_usb_present(chip) | is_dc_present(chip) |
			  chip->hvdcp_3_det_ignore_uv;
	if (!charger_present)
		return POWER_SUPPLY_STATUS_DISCHARGING;

@@ -792,7 +793,7 @@ static int get_prop_batt_status(struct smbchg_chip *chip)

	chg_type = (reg & CHG_TYPE_MASK) >> CHG_TYPE_SHIFT;

	if (chg_type == BATT_NOT_CHG_VAL)
	if (chg_type == BATT_NOT_CHG_VAL && !chip->hvdcp_3_det_ignore_uv)
		status = POWER_SUPPLY_STATUS_DISCHARGING;
	else
		status = POWER_SUPPLY_STATUS_CHARGING;