Skip to content

Commit

Permalink
sbs-battery.c: Capacity attr = remaining relative capacity
Browse files Browse the repository at this point in the history
Currently, the capacity exported by this driver refers to reg 0x0e,
which is the absolute state of charge which according to SBS
refers to the design capacity/ energy of the battery. It can be
> 100 % and drops below 100 % for a fully charged battery with
the battery aging.

This is not what the user exspects of a remaining capacity
indication between 0 and 100 % with 100 % referring to
a fully charged battery. This is provided by SBS reg 0x0d,
which is the relative state of charge referring to the
full charge capacity.

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
  • Loading branch information
Nikolaus Voss authored and Anton Vorontsov committed May 6, 2012
1 parent 81a0838 commit b1f092f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/sbs-battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static const struct chip_data {
[REG_CURRENT] =
SBS_DATA(POWER_SUPPLY_PROP_CURRENT_NOW, 0x0A, -32768, 32767),
[REG_CAPACITY] =
SBS_DATA(POWER_SUPPLY_PROP_CAPACITY, 0x0E, 0, 100),
SBS_DATA(POWER_SUPPLY_PROP_CAPACITY, 0x0D, 0, 100),
[REG_REMAINING_CAPACITY] =
SBS_DATA(POWER_SUPPLY_PROP_ENERGY_NOW, 0x0F, 0, 65535),
[REG_REMAINING_CAPACITY_CHARGE] =
Expand Down

0 comments on commit b1f092f

Please sign in to comment.