From 13e0aa469e11f31a83f32f614c1331630851af28 Mon Sep 17 00:00:00 2001 From: Dirk Brandewie Date: Tue, 24 Jan 2012 09:26:08 -0800 Subject: [PATCH] max17042: Change capacity property to use reported SOC register 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 Signed-off-by: Dirk Brandewie Signed-off-by: Anton Vorontsov --- 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 3a30a27b094..bd88debf9d5 100644 --- a/drivers/power/max17042_battery.c +++ b/drivers/power/max17042_battery.c @@ -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; -- 2.39.5