]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: sbs-battery: Add delay when changing capacity mode bit
authorPhil Reid <preid@electromag.com.au>
Tue, 11 Jul 2017 09:43:43 +0000 (17:43 +0800)
committerSebastian Reichel <sre@kernel.org>
Tue, 25 Jul 2017 09:30:28 +0000 (11:30 +0200)
commite63fddf6ea8b41e2e3589a98ac1585cbd04e855e
tree0d68411b96dc7e372adffd049eca0321decde2e8
parent24632dbf03d0dff1d3a2dd0e5ab8ab5edac46fa0
power: supply: sbs-battery: Add delay when changing capacity mode bit

At least with the Inspired Energy compatible batteries a delay is required
after setting the capacity mode bit from amp to watts or the reverse.
Setting the bit and then immediately pooling the status register results
in an unknown error being returned in the register. Add the delay results
in and ok status being return. This was also seen when reading the charge
and energy registers where the wrong value was returned for the requested
mode.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Tested-by: Michael Heinemann <committed@heine.so>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/sbs-battery.c