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

Commit 00c73b97 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-smb5: Reverse the sign of CURRENT_NOW



Userspace expects CURRENT_NOW to report positive value
when battery is charging and negative during discharge.

Change-Id: Ide61e2df09859fbf1669e4821cc1d2c7fbb684de
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 45cef796
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1367,6 +1367,8 @@ static int smb5_batt_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CURRENT_NOW:
		rc = smblib_get_prop_from_bms(chg,
				POWER_SUPPLY_PROP_CURRENT_NOW, val);
		if (!rc)
			val->intval *= (-1);
		break;
	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
		val->intval = get_client_vote(chg->fcc_votable,