diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-05-25 13:17:21 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-05-25 13:34:06 -0700 |
commit | e704c712ad473160e97717f139ab3929bcd249c1 (patch) | |
tree | 1b87c7ad05a1e97bd04326adc7f6b6239407b10e /chip/lm4/clock.c | |
parent | 89e1d5a1219c87d90e1362716f799b16aad5c921 (diff) | |
download | chrome-ec-e704c712ad473160e97717f139ab3929bcd249c1.tar.gz |
Better help for console commands
Additional help messages and usage are gated by
CONFIG_CONSOLE_CMDHELP, so we can turn it on if there's space (adds
about 3KB to image size) and turn it off when there isn't.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=none
TEST=manual
1) help
2) help list
3) help gpioset
4) gpioset -> wrong number of params
5) gpioset fred 0 -> param1 bad
6) gpioset cpu_prochot fred -> param2 bad
Change-Id: Ibe99f37212020f763ebe65a068e6aa83a809a370
Diffstat (limited to 'chip/lm4/clock.c')
-rw-r--r-- | chip/lm4/clock.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chip/lm4/clock.c b/chip/lm4/clock.c index e709fa0b62..a342404fd5 100644 --- a/chip/lm4/clock.c +++ b/chip/lm4/clock.c @@ -197,7 +197,10 @@ static int command_sleep(int argc, char **argv) return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(sleep, command_sleep); +DECLARE_CONSOLE_COMMAND(sleep, command_sleep, + "[level [clock]]", + "Drop into sleep", + NULL); static int command_pll(int argc, char **argv) @@ -215,7 +218,7 @@ static int command_pll(int argc, char **argv) char *e; div = strtoi(argv[1], &e, 10); if (*e) - return EC_ERROR_INVAL; + return EC_ERROR_PARAM1; LM4_SYSTEM_RCC = LM4_SYSTEM_RCC_SYSDIV(div - 1) | LM4_SYSTEM_RCC_BYPASS | @@ -237,7 +240,10 @@ static int command_pll(int argc, char **argv) ccprintf("Clock: %d Hz\n", clock_get_freq()); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(pll, command_pll); +DECLARE_CONSOLE_COMMAND(pll, command_pll, + "[ on | off | <div> ]", + "Get/set PLL state", + NULL); /*****************************************************************************/ /* Initialization */ |