summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2020-05-08 12:23:04 +1000
committerCommit Bot <commit-bot@chromium.org>2020-05-08 08:25:35 +0000
commitcd38ef6dee78c0461cce24d32c30932519b8824b (patch)
tree133b5d2053a99f0bc9e129b1ed40e49b181944ff
parentafc3d3be1e307d70f109f6e31dfa55e4c17ae5fa (diff)
downloadchrome-ec-cd38ef6dee78c0461cce24d32c30932519b8824b.tar.gz
idle: reduce set of idle command actions
Remove 'deep sleep' and 'invalid' idle actions from the idle console command. BUG=b:156032428 TEST='idle s' and 'idle w' work when the console is open. Change-Id: I9da2fa0d679ef89ecb2eaaad82541bd3e9e16140 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189616 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--chip/g/idle.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/chip/g/idle.c b/chip/g/idle.c
index ae7760ced6..2e872848d4 100644
--- a/chip/g/idle.c
+++ b/chip/g/idle.c
@@ -43,20 +43,18 @@ BUILD_ASSERT(ARRAY_SIZE(idle_name) == NUM_CHOICES);
static int command_idle(int argc, char **argv)
{
- int i;
-
if (argc > 1) {
if (!strncasecmp("c", argv[1], 1)) {
GREG32(PMU, PWRDN_SCRATCH17) = 0;
} else if (console_is_restricted()) {
ccprintf("Console is locked, cannot set idle state\n");
return EC_ERROR_INVAL;
+ } else if (!strncasecmp("w", argv[1], 1)) {
+ idle_action = IDLE_WFI;
+ } else if (!strncasecmp("s", argv[1], 1)) {
+ idle_action = IDLE_SLEEP;
} else {
- for (i = 1; i < ARRAY_SIZE(idle_name); i++)
- if (!strncasecmp(idle_name[i], argv[1], 1)) {
- idle_action = i;
- break;
- }
+ return EC_ERROR_INVAL;
}
}
@@ -66,8 +64,8 @@ static int command_idle(int argc, char **argv)
return EC_SUCCESS;
}
DECLARE_SAFE_CONSOLE_COMMAND(idle, command_idle,
- "[w|s|d|c]",
- "Set idle action: wfi, sleep, deep sleep or "
+ "[w|s|c]",
+ "Set idle action: wfi, sleep or "
"Clear the deep sleep count");
static int utmi_wakeup_is_enabled(void)