summaryrefslogtreecommitdiff
path: root/include/throttle_ap.h
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2018-05-17 18:55:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-21 18:19:22 -0700
commit453647e21a9e584cd0ee8567efef3d81371ae27f (patch)
treecd1a505e1945c2233cef34a40bf3a9f0a555544e /include/throttle_ap.h
parentd8186821885b7403d3118810ab56fc617068db1d (diff)
downloadchrome-ec-453647e21a9e584cd0ee8567efef3d81371ae27f.tar.gz
charge_state_v2: Throttle AP in low battery voltage
When EC sees voltage drops below BAT_LOW_VOLTAGE_THRESH, we kick off a timer and ask AP to throttle. When the timer expires which means EC hasn't seen under-voltage for BAT_UVP_TIMEOUT_US, we ask AP to stop throttling. We reset the throttling status and do nothing when AP is off (S5). BUG=b:73050145, chromium:838754 BRANCH=scarlet TEST=manually test on scarlet, confirm EC sends EC_HOST_EVENT_THROTTLE_START and EC_HOST_EVENT_THROTTLE_STOP host events when entering/exiting UVP. Change-Id: Ia760989f760f95549f7a8a8acb1d01de23feab5a Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1064983 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: David Schneider <dnschneid@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'include/throttle_ap.h')
-rw-r--r--include/throttle_ap.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/throttle_ap.h b/include/throttle_ap.h
index db651c432e..a149207667 100644
--- a/include/throttle_ap.h
+++ b/include/throttle_ap.h
@@ -31,6 +31,7 @@ enum throttle_type {
enum throttle_sources {
THROTTLE_SRC_THERMAL = 0,
THROTTLE_SRC_BAT_DISCHG_CURRENT,
+ THROTTLE_SRC_BAT_VOLTAGE,
};
/**
@@ -44,7 +45,8 @@ enum throttle_sources {
* @param source Which task is requesting throttling
*/
#if defined(CONFIG_THROTTLE_AP) || \
- defined(CONFIG_THROTTLE_AP_ON_BAT_DISCHG_CURRENT)
+ defined(CONFIG_THROTTLE_AP_ON_BAT_DISCHG_CURRENT) || \
+ defined(CONFIG_THROTTLE_AP_ON_BAT_VOLTAGE)
void throttle_ap(enum throttle_level level,
enum throttle_type type,