lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 25 Sep 2016 23:10:10 +0200
From:   Wolfgang Wiedmeyer <wolfgit@...dmeyer.de>
To:     sre@...nel.org, dbaryshkov@...il.com, dwmw2@...radead.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Wolfgang Wiedmeyer <wolfgit@...dmeyer.de>
Subject: [PATCH 1/2] power: supply: max17042_battery: use VF SOC register for capacity property

The capacity property uses the RepSOC register to report the current state
of charge. This register did not provide a reliable SOC value during my
testing with the max17047 variant on a Galaxy S3 (Trats2/GT-I9300). The
reported value did not change or even stayed zero in some cases.
However, the VF SOC register provided an accurate SOC value at all times.
It uses the voltage fuel gauge to determine the SOC.

Signed-off-by: Wolfgang Wiedmeyer <wolfgit@...dmeyer.de>
---
 drivers/power/max17042_battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index da7a75f..20cb1fd 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -246,7 +246,7 @@ static int max17042_get_property(struct power_supply *psy,
 		val->intval = data * 625 / 8;
 		break;
 	case POWER_SUPPLY_PROP_CAPACITY:
-		ret = regmap_read(map, MAX17042_RepSOC, &data);
+		ret = regmap_read(map, MAX17042_VFSOC, &data);
 		if (ret < 0)
 			return ret;
 
-- 
Website: https://fossencdi.org
OpenPGP: 0F30 D1A0 2F73 F70A 6FEE  048E 5816 A24C 1075 7FC4
Key download: https://wiedmeyer.de/keys/ww.asc

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ