Skip to content

Commit

Permalink
max17042: Change capacity property to use reported SOC register
Browse files Browse the repository at this point in the history
The SOC register (0dh) reports the state of charge before empty
compensation adjustments are applied.  The max value reported by this
register will decrease as the battery ages.

Use the RepSOC register (06h) to report the capacity of the
battery. RepSOC contains a filtered version of the battery capacity
after empty compensation adjustments have been applied.

Reported-by: Gary Keyes <gary.e.keyes@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
  • Loading branch information
Dirk Brandewie authored and Anton Vorontsov committed Mar 26, 2012
1 parent e5f3872 commit 13e0aa4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/max17042_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int max17042_get_property(struct power_supply *psy,
val->intval = ret * 625 / 8;
break;
case POWER_SUPPLY_PROP_CAPACITY:
ret = max17042_read_reg(chip->client, MAX17042_SOC);
ret = max17042_read_reg(chip->client, MAX17042_RepSOC);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 13e0aa4

Please sign in to comment.