summaryrefslogtreecommitdiff
path: root/common/system_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/system_common.c')
-rw-r--r--common/system_common.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/common/system_common.c b/common/system_common.c
index 778a7ef672..d651fd7579 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -758,15 +758,23 @@ DECLARE_CONSOLE_COMMAND(syslock, command_system_lock,
*/
static int command_sleepmask(int argc, char **argv)
{
- int off;
+ int v;
if (argc >= 2) {
- off = strtoi(argv[1], NULL, 10);
-
- if (off)
- disable_sleep(SLEEP_MASK_FORCE);
- else
- enable_sleep(SLEEP_MASK_FORCE);
+ if (parse_bool(argv[1], &v)) {
+ if (v)
+ disable_sleep(SLEEP_MASK_FORCE_NO_DSLEEP);
+ else
+ enable_sleep(SLEEP_MASK_FORCE_NO_DSLEEP);
+ } else {
+ char *e;
+ v = strtoi(argv[1], &e, 10);
+ if (*e)
+ return EC_ERROR_PARAM1;
+
+ /* Set sleep mask directly. */
+ sleep_mask = v;
+ }
}
ccprintf("sleep mask: %08x\n", sleep_mask);
@@ -774,8 +782,8 @@ static int command_sleepmask(int argc, char **argv)
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(sleepmask, command_sleepmask,
- "[<sleep_mask>]",
- "Display/force sleep mask",
+ "[ on | off | <sleep_mask>]",
+ "Display/force sleep mask.\nSee also 'dsleepmask'.",
NULL);
#endif