Skip to content

Commit

Permalink
ds2760_battery: Fix indexing of the 4 active full EEPROM registers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Parsons authored and Anton Vorontsov committed May 20, 2011
1 parent f17ef9b commit 3af98a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/ds2760_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3af98a8

Please sign in to comment.