mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
tools: gpio: add option to report wall-clock time to gpio-event-mon
Add support for selecting the realtime clock for events. Signed-off-by: Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20201014231158.34117-4-warthog618@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
da777be6de
commit
e0822cf9b8
|
@ -148,6 +148,7 @@ void print_usage(void)
|
||||||
" -s Set line as open source\n"
|
" -s Set line as open source\n"
|
||||||
" -r Listen for rising edges\n"
|
" -r Listen for rising edges\n"
|
||||||
" -f Listen for falling edges\n"
|
" -f Listen for falling edges\n"
|
||||||
|
" -w Report the wall-clock time for events\n"
|
||||||
" -b <n> Debounce the line with period n microseconds\n"
|
" -b <n> Debounce the line with period n microseconds\n"
|
||||||
" [-c <n>] Do <n> loops (optional, infinite loop if not stated)\n"
|
" [-c <n>] Do <n> loops (optional, infinite loop if not stated)\n"
|
||||||
" -? This helptext\n"
|
" -? This helptext\n"
|
||||||
|
@ -173,7 +174,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
memset(&config, 0, sizeof(config));
|
memset(&config, 0, sizeof(config));
|
||||||
config.flags = GPIO_V2_LINE_FLAG_INPUT;
|
config.flags = GPIO_V2_LINE_FLAG_INPUT;
|
||||||
while ((c = getopt(argc, argv, "c:n:o:b:dsrf?")) != -1) {
|
while ((c = getopt(argc, argv, "c:n:o:b:dsrfw?")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
loops = strtoul(optarg, NULL, 10);
|
loops = strtoul(optarg, NULL, 10);
|
||||||
|
@ -204,6 +205,9 @@ int main(int argc, char **argv)
|
||||||
case 'f':
|
case 'f':
|
||||||
config.flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING;
|
config.flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING;
|
||||||
break;
|
break;
|
||||||
|
case 'w':
|
||||||
|
config.flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
print_usage();
|
print_usage();
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue