charge_state_v2: Add a hysteresis for under-voltage throttling
charge_state_v2: Add a hysteresis for under-voltage throttling

There is a potential loop:
(1) We throttle AP when we see under-voltage.
(2) VBAT bumps because throttling starts. From our experiment,
    AP throttling saves ~1A, and thus VBAT increases by ~80mV.
(3) VBAT hasn't hit BAT_LOW_VOLTAGE_THRESH for BAT_UVP_TIMEOUT_US,
    so we stop throttling.
(4) VBAT again drops below BAT_LOW_VOLTAGE_THRESH.
(5) Go back to (1).

So let's introduce a hysteresis to under-voltage throttling.
We stop throttling only when we are confident that even if we stop
throttling, the battery voltage will stay above BAT_LOW_VOLTAGE_THRESH.

BUG=b:73050145, chromium:838754
BRANCH=scarlet
TEST=manually test on scarlet

Change-Id: Ic0c17a7d37d5d6ee38c7b19f9b65d17421e55cbc
Signed-off-by: Philip Chen <3ee404f9ef892bc3fda6e6a76e65843b5fa44db2@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1070568
Commit-Ready: Philip Chen <3ee404f9ef892bc3fda6e6a76e65843b5fa44db2@chromium.org>
Tested-by: Philip Chen <3ee404f9ef892bc3fda6e6a76e65843b5fa44db2@chromium.org>
Reviewed-by: Nicolas Boichat <f3daba1cdc403799935674d3cd4b0e5bd1804232@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec