summaryrefslogtreecommitdiff
path: root/include/throttle_ap.h
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2018-04-03 15:10:01 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-10 19:41:04 -0700
commitbf62593ebd4dead8553ca5615290fe372198e846 (patch)
tree31a56e78ac8201ef2f3001c438881ea9120df7e2 /include/throttle_ap.h
parentec1428f96dd750d20047b6b1c4a72e270d71682e (diff)
downloadchrome-ec-bf62593ebd4dead8553ca5615290fe372198e846.tar.gz
charge_state_v2: Throttle AP in high battery discharge current
When EC sees discharge current hit BAT_MAX_DISCHG_CURRENT, we kick off a timer and ask AP to throttle. Then EC keeps monitoring discharge current. If the current doesn't drop below BAT_MAX_DISCHG_CURRENT - BAT_OCP_HYSTERESIS, we restart the timer and notify AP again, which shouldn't happen unless AP misses or ignores the first notification. When the timer expires, which means EC hasn't seen over-current for BAT_OCP_TIMEOUT_US, we ask AP to stop throttling. BUG=b:74321682, 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 OCP. Change-Id: I1e55fc23249596d8afec52a3885655ca9c1f2151 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/994188 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Diffstat (limited to 'include/throttle_ap.h')
-rw-r--r--include/throttle_ap.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/throttle_ap.h b/include/throttle_ap.h
index 8d2af51db9..db651c432e 100644
--- a/include/throttle_ap.h
+++ b/include/throttle_ap.h
@@ -30,7 +30,7 @@ enum throttle_type {
*/
enum throttle_sources {
THROTTLE_SRC_THERMAL = 0,
- THROTTLE_SRC_POWER,
+ THROTTLE_SRC_BAT_DISCHG_CURRENT,
};
/**
@@ -43,7 +43,9 @@ enum throttle_sources {
* @param type Type of throttling desired
* @param source Which task is requesting throttling
*/
-#ifdef CONFIG_TEMP_SENSOR
+#if defined(CONFIG_THROTTLE_AP) || \
+ defined(CONFIG_THROTTLE_AP_ON_BAT_DISCHG_CURRENT)
+
void throttle_ap(enum throttle_level level,
enum throttle_type type,
enum throttle_sources source);