Commit 3af98a8f39dee8ffb93a93e4145276d58e66e48f

Authored by Paul Parsons
Committed by Anton Vorontsov
1 parent f17ef9b2da

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/power/ds2760_battery.c
... ... @@ -186,7 +186,7 @@
186 186  
187 187 scale[0] = di->full_active_uAh;
188 188 for (i = 1; i < 5; i++)
189   - scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 2 + i];
  189 + scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 1 + i];
190 190  
191 191 di->full_active_uAh = battery_interpolate(scale, di->temp_C / 10);
192 192 di->full_active_uAh *= 1000; /* convert to µAh */