summaryrefslogtreecommitdiff
path: root/drivers/power/ds2760_battery.c
diff options
context:
space:
mode:
authorPaul Parsons <lost.distance@yahoo.com>2011-04-25 14:43:30 +0000
committerAnton Vorontsov <cbouatmailru@gmail.com>2011-05-20 19:25:09 +0400
commit3af98a8f39dee8ffb93a93e4145276d58e66e48f (patch)
treebe623cfcd8a3fae9e5880d2d52ea6431b75f15d2 /drivers/power/ds2760_battery.c
parentf17ef9b2dade4d7afb605465ef1a926fdfc1a4cc (diff)
ds2760_battery: Fix indexing of the 4 active full EEPROM registers
Fix indexing of the 4 active full EEPROM registers. The indexing was out by 1, accessing the EEPROM registers at 0x23 to 0x26 instead of 0x22 to 0x25. Signed-off-by: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power/ds2760_battery.c')
-rw-r--r--drivers/power/ds2760_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/ds2760_battery.c b/drivers/power/ds2760_battery.c
index e534290f3256..aa60e3791754 100644
--- a/drivers/power/ds2760_battery.c
+++ b/drivers/power/ds2760_battery.c
@@ -186,7 +186,7 @@ static int ds2760_battery_read_status(struct ds2760_device_info *di)
scale[0] = di->full_active_uAh;
for (i = 1; i < 5; i++)
- scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 2 + i];
+ scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 1 + i];
di->full_active_uAh = battery_interpolate(scale, di->temp_C / 10);
di->full_active_uAh *= 1000; /* convert to µAh */