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

Commit 9adc5753 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Guru Das Srinagesh
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 6b785d61
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1303,6 +1303,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_CURRENT_QNOVO:
		val->intval = get_client_vote_locked(chg->fcc_votable,