power: supply: cpcap-battery: Check voltage before orderly_poweroff
authorTony Lindgren <tony@atomide.com>
Wed, 16 Oct 2019 22:30:04 +0000 (15:30 -0700)
committerSebastian Reichel <sre@kernel.org>
Sun, 20 Oct 2019 18:26:14 +0000 (20:26 +0200)
commit639c1524da3b273d20c42ff2387d08eb4b12e903
treebf0c52edcb2be0854237a25618ae0d26490aa96b
parent8bc8fc088bcd9da7ff565620a2778def59902404
power: supply: cpcap-battery: Check voltage before orderly_poweroff

We can get the low voltage interrupt trigger sometimes way too early,
maybe because of CPU load spikes. This causes orderly_poweroff() be
called too easily.

Let's check the voltage before orderly_poweroff in case it was not
yet a permanent condition. We will be getting more interrupts anyways
if the condition persists.

Let's also show the measured voltages for low battery and battery
empty warnings since we have them.

Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cpcap-battery.c