diff options
author | Aseda Aboagye <aaboagye@google.com> | 2015-09-24 14:55:48 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-25 21:09:25 -0700 |
commit | 823d3a2d5121ab8798e03e097b374f78f3051144 (patch) | |
tree | 966bd9ebe6f0b85bed97947ad598e2a91a49beda /include | |
parent | 094a81f5deff3b8cf5342138afefef8d8f34f8ff (diff) | |
download | chrome-ec-823d3a2d5121ab8798e03e097b374f78f3051144.tar.gz |
ec_commands: Add "hibdelay" as an EC host command.
Currently, the only way to prevent a system from hibernating is via the
EC console command "hibdelay". This commit adds the host command
equivalent so that it can be set elsewhere. The host command takes the
amount of time in seconds to delay hibernation by and responds with the
current time in the G3 power state, the time remaining before
hibernation should be invoked, and the current setting of the
hibernation delay.
BUG=chrome-os-partner:45608
BUG=chrome-os-partner:44831
BRANCH=None
TEST=Build and flash on samus. Issue the host command from EC
console. Verify that the hibernation delay was updated by checking with
the hibdelay command.
Change-Id: I34725516507995c3c0337d5d64736d21a472866c
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/302197
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index ddf47d4fc7..b2eb3fe385 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2909,6 +2909,41 @@ struct ec_params_external_power_limit_v1 { #define EC_POWER_LIMIT_NONE 0xffff /*****************************************************************************/ +/* Hibernate/Deep Sleep Commands */ + +/* Set the delay before going into hibernation. */ +#define EC_CMD_HIBERNATION_DELAY 0xa8 + +struct ec_params_hibernation_delay { + /* + * Seconds to wait in G3 before hibernate. Pass in 0 to read the + * current settings without changing them. + */ + uint32_t seconds; +}; + +struct ec_response_hibernation_delay { + /* + * The current time in seconds in which the system has been in the G3 + * state. This value is reset if the EC transitions out of G3. + */ + uint32_t time_g3; + + /* + * The current time remaining in seconds until the EC should hibernate. + * This value is also reset if the EC transitions out of G3. + */ + uint32_t time_remaining; + + /* + * The current time in seconds that the EC should wait in G3 before + * hibernating. + */ + uint32_t hibernate_delay; +}; + + +/*****************************************************************************/ /* Smart battery pass-through */ /* Get / Set 16-bit smart battery registers */ |