Skip to content
Commit 297a533b authored by Lars-Peter Clausen's avatar Lars-Peter Clausen
Browse files

bq27x00: Cache battery registers



This patch adds a register cache to the bq27x00 battery driver.
Usually multiple, if not all, power_supply properties are queried at once,
for example when an uevent is generated. Since some registers are used by
multiple properties caching the registers should reduce the number of
reads.

The cache is valid for 5 seconds this roughly matches the internal update
interval of the current register for the bq27000/bq27200.

Fast changing properties(*_NOW) which can be obtained by reading a single
register are not cached.

It will also be used in the follow up patch to check if the battery status
has been changed since the last update to emit power_supply_changed events.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Tested-by: default avatarGrazvydas Ignotas <notasas@gmail.com>
parent 7fb7ba58
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment