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

Commit 707a1681 authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-smbcharger: fix battery charging logic for battery types



Currently, the battery charging enable/disable logic for unknown and
loading batteries is incorrect. The current implementation will always
charge loading batteries and never charge if qcom,charge-unknown-battery
is defined.

Fix this by correcting the conditional check in check_battery_type.

CRs-Fixed: 861687
Change-Id: I427816a33b2bc44a573f03edc81045bfcc28e41f
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent d4bc64ea
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3083,8 +3083,8 @@ static void check_battery_type(struct smbchg_chip *chip)
		chip->bms_psy->get_property(chip->bms_psy,
				POWER_SUPPLY_PROP_BATTERY_TYPE, &prop);
		en = (strcmp(prop.strval, UNKNOWN_BATT_TYPE) != 0
				&& !chip->charge_unknown_battery)
			|| strcmp(prop.strval, LOADING_BATT_TYPE) != 0;
				|| chip->charge_unknown_battery)
			&& (strcmp(prop.strval, LOADING_BATT_TYPE) != 0);
		smbchg_battchg_en(chip, en, REASON_BATTCHG_UNKNOWN_BATTERY,
				&unused);
	}