mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	bgolaszewski@baylibre.com, linus.walleij@linaro.org
Cc: Kent Gibson <warthog618@gmail.com>
Subject: [PATCH v2 3/3] tools: gpio: add option to report wall-clock time to gpio-event-mon
Date: Thu, 15 Oct 2020 07:11:58 +0800	[thread overview]
Message-ID: <20201014231158.34117-4-warthog618@gmail.com> (raw)
In-Reply-To: <20201014231158.34117-1-warthog618@gmail.com>

Add support for selecting the realtime clock for events.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpio/gpio-event-mon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 <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;
-- 
2.28.0


  parent reply	other threads:[~2020-10-15  1:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
2020-10-14 23:11 ` [PATCH v2 1/3] " Kent Gibson
2020-10-16 14:13   ` Andy Shevchenko
2020-10-16 23:27     ` Kent Gibson
2020-10-14 23:11 ` [PATCH v2 2/3] tools: gpio: add support for reporting realtime event clock to lsgpio Kent Gibson
2020-10-14 23:11 ` Kent Gibson [this message]
2020-10-28 16:01 ` [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Linus Walleij
2020-10-28 23:22   ` Kent Gibson
2020-10-30 14:49     ` Bartosz Golaszewski
2020-10-30 14:52       ` Bartosz Golaszewski
2020-10-31  0:01         ` Kent Gibson
2020-11-02  8:56           ` Bartosz Golaszewski
2020-11-06 13:49           ` Linus Walleij
2020-12-01 18:20             ` Bartosz Golaszewski
2020-12-05 22:23 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201014231158.34117-4-warthog618@gmail.com \
    --to=warthog618@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome