From da777be6de014be6b302644685797ed3860a0d0d Mon Sep 17 00:00:00 2001 From: Kent Gibson Date: Thu, 15 Oct 2020 07:11:57 +0800 Subject: tools: gpio: add support for reporting realtime event clock to lsgpio Add support for reporting if a line is configured to report realtime timestamps in events. Signed-off-by: Kent Gibson Link: https://lore.kernel.org/r/20201014231158.34117-3-warthog618@gmail.com Signed-off-by: Linus Walleij --- tools/gpio/lsgpio.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools') diff --git a/tools/gpio/lsgpio.c b/tools/gpio/lsgpio.c index 5a05a454d0c9..c61d061247e1 100644 --- a/tools/gpio/lsgpio.c +++ b/tools/gpio/lsgpio.c @@ -65,6 +65,10 @@ struct gpio_flag flagnames[] = { .name = "bias-disabled", .mask = GPIO_V2_LINE_FLAG_BIAS_DISABLED, }, + { + .name = "clock-realtime", + .mask = GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME, + }, }; static void print_attributes(struct gpio_v2_line_info *info) -- cgit v1.2.3 From e0822cf9b892ed051830daaf57896aca48c8567b Mon Sep 17 00:00:00 2001 From: Kent Gibson Date: Thu, 15 Oct 2020 07:11:58 +0800 Subject: 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 Link: https://lore.kernel.org/r/20201014231158.34117-4-warthog618@gmail.com Signed-off-by: Linus Walleij --- tools/gpio/gpio-event-mon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c index 90c3155f05b1..cacd66ad7926 100644 --- a/tools/gpio/gpio-event-mon.c +++ b/tools/gpio/gpio-event-mon.c @@ -148,6 +148,7 @@ void print_usage(void) " -s Set line as open source\n" " -r Listen for rising edges\n" " -f Listen for falling edges\n" + " -w Report the wall-clock time for events\n" " -b Debounce the line with period n microseconds\n" " [-c ] Do loops (optional, infinite loop if not stated)\n" " -? This helptext\n" @@ -173,7 +174,7 @@ int main(int argc, char **argv) memset(&config, 0, sizeof(config)); 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) { case 'c': loops = strtoul(optarg, NULL, 10); @@ -204,6 +205,9 @@ int main(int argc, char **argv) case 'f': config.flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING; break; + case 'w': + config.flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME; + break; case '?': print_usage(); return -1; -- cgit v1.2.3