From 8fb18f174ce9aac91c5fc41ebe4b12c0aa746ba0 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Tue, 27 Mar 2018 15:49:26 +0800 Subject: common/ec_ec_comm_master/slave: Add support for EC hibernate Allows the lid to hibernate the base. BRANCH=none BUG=b:71874971 TEST=With following change, lid hibernates the base when in S5, and no AC is connected. Change-Id: I8c8017d638442ba8b17c8117d0b1b31f3538925f Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/981914 Reviewed-by: Randall Spangler --- include/ec_ec_comm_master.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/ec_ec_comm_master.h b/include/ec_ec_comm_master.h index adaf564c65..ccd46a9bc2 100644 --- a/include/ec_ec_comm_master.h +++ b/include/ec_ec_comm_master.h @@ -46,4 +46,13 @@ int ec_ec_master_base_charge_control(int max_current, int otg_voltage, int allow_charging); +/** + * Sends EC_CMD_REBOOT_EC command to slave, with EC_REBOOT_HIBERNATE parameter. + * + * @return EC_RES_ERROR on communication error (should always be the case if the + * slave successfully hibernates, as it will not be able to write back the + * response, else forwards the error code from the slave. + */ +int ec_ec_master_hibernate(void); + #endif /* EC_EC_COMM_MASTER_H_ */ -- cgit v1.2.1