Skip to content

Commit

Permalink
power: supply: max17042_battery: use VF SOC register for capacity pro…
Browse files Browse the repository at this point in the history
…perty

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 0 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@wiedmeyer.de>
  • Loading branch information
wiewo authored and ChronoMonochrome committed Mar 19, 2021
1 parent 1b64886 commit 1287ea6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/max17042_battery.c
Expand Up @@ -316,7 +316,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;

Expand Down

0 comments on commit 1287ea6

Please sign in to comment.