diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-05-21 10:29:23 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-05-21 14:57:08 -0700 |
commit | b2c4ee6cf88baffa7f69b1551fcda0e468bae216 (patch) | |
tree | 57d84af558f9210220668dc159770b4571aa5710 /common/host_event_commands.c | |
parent | 1ac197d566d74b5dfd2abbd57c191e464aa46d8b (diff) | |
download | chrome-ec-b2c4ee6cf88baffa7f69b1551fcda0e468bae216.tar.gz |
Even more debug command cleanup to save space
BUG=none
TEST=(run the commands)
Change-Id: Ibc414ffd594e06dbdce64c51859b6f247bb10d36
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/host_event_commands.c')
-rw-r--r-- | common/host_event_commands.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c index c9cb0e0cc6..70ee5a102c 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -19,39 +19,30 @@ static int command_host_event(int argc, char **argv) if (argc == 3) { char *e; int i = strtoi(argv[2], &e, 0); - if (*e) { - ccputs("Invalid event mask\n"); + if (*e) return EC_ERROR_INVAL; - } - if (!strcasecmp(argv[1], "set")) { - ccprintf("Setting host event mask 0x%08x\n", i); + if (!strcasecmp(argv[1], "set")) lpc_set_host_events(i); - } else if (!strcasecmp(argv[1], "clear")) { - ccprintf("Clearing host event mask 0x%08x\n", i); + else if (!strcasecmp(argv[1], "clear")) lpc_clear_host_events(i); - } else if (!strcasecmp(argv[1], "smi")) { - ccprintf("Setting SMI mask to 0x%08x\n", i); + else if (!strcasecmp(argv[1], "smi")) lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, i); - } else if (!strcasecmp(argv[1], "sci")) { - ccprintf("Setting SCI mask to 0x%08x\n", i); + else if (!strcasecmp(argv[1], "sci")) lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, i); - } else if (!strcasecmp(argv[1], "wake")) { - ccprintf("Setting wake mask to 0x%08x\n", i); + else if (!strcasecmp(argv[1], "wake")) lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, i); - } else { - ccputs("Unknown sub-command\n"); + else return EC_ERROR_INVAL; - } } /* Print current SMI/SCI status */ - ccprintf("Raw host events: 0x%08x\n", lpc_get_host_events()); - ccprintf("SMI mask: 0x%08x\n", + ccprintf("Events: 0x%08x\n", lpc_get_host_events()); + ccprintf("SMI mask: 0x%08x\n", lpc_get_host_event_mask(LPC_HOST_EVENT_SMI)); - ccprintf("SCI mask: 0x%08x\n", + ccprintf("SCI mask: 0x%08x\n", lpc_get_host_event_mask(LPC_HOST_EVENT_SCI)); - ccprintf("Wake mask: 0x%08x\n", + ccprintf("Wake mask: 0x%08x\n", lpc_get_host_event_mask(LPC_HOST_EVENT_WAKE)); return EC_SUCCESS; } |