Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kent Gibson and committed by
Linus Walleij
e0822cf9 da777be6

+5 -1
+5 -1
tools/gpio/gpio-event-mon.c
··· 148 148 " -s Set line as open source\n" 149 149 " -r Listen for rising edges\n" 150 150 " -f Listen for falling edges\n" 151 + " -w Report the wall-clock time for events\n" 151 152 " -b <n> Debounce the line with period n microseconds\n" 152 153 " [-c <n>] Do <n> loops (optional, infinite loop if not stated)\n" 153 154 " -? This helptext\n" ··· 174 173 175 174 memset(&config, 0, sizeof(config)); 176 175 config.flags = GPIO_V2_LINE_FLAG_INPUT; 177 - while ((c = getopt(argc, argv, "c:n:o:b:dsrf?")) != -1) { 176 + while ((c = getopt(argc, argv, "c:n:o:b:dsrfw?")) != -1) { 178 177 switch (c) { 179 178 case 'c': 180 179 loops = strtoul(optarg, NULL, 10); ··· 204 203 break; 205 204 case 'f': 206 205 config.flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING; 206 + break; 207 + case 'w': 208 + config.flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME; 207 209 break; 208 210 case '?': 209 211 print_usage();