summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-03-11 11:44:08 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-03-14 04:51:15 +0000
commita7ed75d1b31fb9758421a830f5356d4da713a8b0 (patch)
tree65eb98bd65293252f90439b4d75fdfeea1ba7c49
parentb3cbacaf183ec1cc7715e693282ba82f6954d66b (diff)
downloadchrome-ec-a7ed75d1b31fb9758421a830f5356d4da713a8b0.tar.gz
Kefka: Disable hibernate on G3 idle, cutoff battery on critical charge
Kefka currently hibernates when it's idel in G3 for 60 min. This behavior makes Kefka drain a battery deeply over a long idle (3+ months). This patch disable hibernation in G3. Kefka currently hibernates when the battery reaches critical level (2%). This patch sets the threshold to 5% and makes EC cutoff a battery instead of hibernate. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/124266129 BRANCH=strago TEST=Make Kefka drain battery and verify it cuts off a battery when the soc reaches 5%. Verify Kefka doesn't hibernate after G3 idle timer exipres. Change-Id: Ib8cc770c1de17a1a47abf71b0ab45e732e07b267 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1515722 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--board/kefka/board.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/kefka/board.c b/board/kefka/board.c
index fc10a2caac..3a893392e6 100644
--- a/board/kefka/board.c
+++ b/board/kefka/board.c
@@ -280,3 +280,27 @@ static void get_motion_sensors_count(void)
motion_sensor_count = 0;
}
DECLARE_HOOK(HOOK_INIT, get_motion_sensors_count, HOOK_PRIO_FIRST);
+
+
+enum critical_shutdown board_critical_shutdown_check(
+ struct charge_state_data *curr)
+{
+ return CRITICAL_SHUTDOWN_CUTOFF;
+}
+
+uint8_t board_set_battery_level_shutdown(void)
+{
+ /* Cut off at 5% */
+ return 6;
+}
+
+enum critical_shutdown board_system_is_idle(uint64_t last_shutdown_time,
+ uint64_t *target, uint64_t now)
+{
+ /*
+ * Don't do anything. Battery eventually will reach critical
+ * charge (5%). Then, board_critical_shutdown_check will be
+ * called and request cutoff.
+ */
+ return CRITICAL_SHUTDOWN_IGNORE;
+}