]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - tools/gpio/gpio-event-mon.c
Merge tag 'i3c/fixes-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c...
[mirror_ubuntu-hirsute-kernel.git] / tools / gpio / gpio-event-mon.c
index 90c3155f05b1e142fd14f921b4f6416d5965d5fc..a2b233fdb572eb687674315054e19bfe7e070d3b 100644 (file)
@@ -107,8 +107,8 @@ int monitor_device(const char *device_name,
                        ret = -EIO;
                        break;
                }
-               fprintf(stdout, "GPIO EVENT at %llu on line %d (%d|%d) ",
-                       event.timestamp_ns, event.offset, event.line_seqno,
+               fprintf(stdout, "GPIO EVENT at %" PRIu64 " on line %d (%d|%d) ",
+                       (uint64_t)event.timestamp_ns, event.offset, event.line_seqno,
                        event.seqno);
                switch (event.id) {
                case GPIO_V2_LINE_EVENT_RISING_EDGE:
@@ -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 <n>     Debounce the line with period n microseconds\n"
                " [-c <n>]    Do <n> 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;