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

Commit 57cfd9e8 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: smb5-lib: Show unknown battery status for debug battery



For a debug battery (battery id is 7.5 K), show the battery
status as unknown instead of discharging/not charging. Since the
charging is disabled for debug battery, this makes sense. Also,
it helps the userspace to stay in poweron mode based on the user
request.

Change-Id: Ia83e2c3903a01c0f61e9cbbb5b05f30668f6d652
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 54ada83a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1880,6 +1880,16 @@ int smblib_get_prop_batt_status(struct smb_charger *chg,
	u8 stat;
	int rc, suspend = 0;

	rc = smblib_get_prop_from_bms(chg,
			POWER_SUPPLY_PROP_DEBUG_BATTERY, &pval);
	if (rc < 0) {
		pr_err_ratelimited("Couldn't get debug battery prop rc=%d\n",
				rc);
	} else if (pval.intval == 1) {
		val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
		return 0;
	}

	if (chg->dbc_usbov) {
		rc = smblib_get_prop_usb_present(chg, &pval);
		if (rc < 0) {