Messages in this thread Patch in this message | | | From | dirk.brandewie@gmail ... | Subject | [PATCH 5/5] max17042: Change capacity property to use reported SOC register | Date | Tue, 24 Jan 2012 09:26:08 -0800 |
| |
From: Dirk Brandewie <dirk.brandewie@gmail.com>
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> --- drivers/power/max17042_battery.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c index 6e96b58..2194278 100644 --- a/drivers/power/max17042_battery.c +++ b/drivers/power/max17042_battery.c @@ -160,7 +160,7 @@ static int max17042_get_property(struct power_supply *psy, break; case POWER_SUPPLY_PROP_CAPACITY: val->intval = max17042_read_reg(chip->client, - MAX17042_SOC) / 256; + MAX17042_RepSOC) / 256; break; case POWER_SUPPLY_PROP_CHARGE_FULL: val->intval = max17042_read_reg(chip->client, -- 1.7.7.5
| |