Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165507
b: refs/heads/master
c: 25f2bfa
h: refs/heads/master
i:
  165505: db1a036
  165503: d31742b
v: v3
  • Loading branch information
Daniel Mack authored and Anton Vorontsov committed Jul 30, 2009
1 parent 7092228 commit ea3c0ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1e72193ea3fa02e96bf3aa66006e18d107d0266
refs/heads/master: 25f2bfa62ae77820a8185734c4a2ab7f3971a2fc
9 changes: 7 additions & 2 deletions trunk/drivers/power/ds2760_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,13 @@ static int ds2760_battery_read_status(struct ds2760_device_info *di)
di->full_active_uAh = di->raw[DS2760_ACTIVE_FULL] << 8 |
di->raw[DS2760_ACTIVE_FULL + 1];

scale[0] = di->raw[DS2760_ACTIVE_FULL] << 8 |
di->raw[DS2760_ACTIVE_FULL + 1];
/* If the full_active_uAh value is not given, fall back to the rated
* capacity. This is likely to happen when chips are not part of the
* battery pack and is therefore not bootstrapped. */
if (di->full_active_uAh == 0)
di->full_active_uAh = di->rated_capacity / 1000L;

scale[0] = di->full_active_uAh;
for (i = 1; i < 5; i++)
scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 2 + i];

Expand Down

0 comments on commit ea3c0ff

Please sign in to comment.