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

Commit 93ac7369 authored by Kavya Nunna's avatar Kavya Nunna
Browse files

power: qpnp-smbcharger: Reverse the sign of CURRENT_NOW



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

Change-Id: Ie8da8e1be6d153e38191b207b204b77155b26e62
Signed-off-by: default avatarKavya Nunna <knunna@codeaurora.org>
parent c62ec7b0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014-2016, 2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, 2018-2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -6075,6 +6075,7 @@ static int smbchg_battery_get_property(struct power_supply *psy,
		break;
	case POWER_SUPPLY_PROP_CURRENT_NOW:
		val->intval = get_prop_batt_current_now(chip);
		val->intval *= (-1);
		break;
	case POWER_SUPPLY_PROP_VOLTAGE_NOW:
		val->intval = get_prop_batt_voltage_now(chip);