linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gary E. Miller" <gem@rellim.com>
To: linux-kernel@vger.kernel.org
Cc: "Gary E. Miller" <gem@rellim.com>
Cc: "Rodolfo Giometti" <giometti@enneenne.com>
Cc: "Ricardo Martin" s <rasm@fe.up.pt>
Cc: "James Nus" s <jamesnuss@nanometrics.ca>
Cc: "Jan Luebbe" <jlu@pengutronix.de>
Subject: [PATCH] PPS: Restore lost capture-clear option to pps-gpio module.
Date: Thu, 2 Apr 2015 12:21:43 -0700	[thread overview]
Message-ID: <201504022004.t32K4xbW013508@spidey.rellim.com> (raw)

In the conversion from platform to device tree the capture-clear
option was lost.

capture-clear is needed so that time_pps_fetch() will report both
edges of each PPS pulse.  Both edges are needed so that userland
programs, like gpsd, can autodetect the leading and trailing PPS
edges.

Signed-off-by: Gary E. Miller <gem@rellim.com>
Fixes: c5dbcf8b70b5 ("pps-gpio: add device-tree binding and support")
Cc: Ricardo Martins <rasm@fe.up.pt>
Cc: James Nuss <jamesnuss@nanometrics.ca>
Cc: Jan Luebbe <jlu@pengutronix.de>
Acked-by: Rodolfo Giometti <giometti@linux.it>
> ---`
---
 Documentation/devicetree/bindings/pps/pps-gpio.txt | 2 ++
 drivers/pps/clients/pps-gpio.c                     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/pps/pps-gpio.txt b/Documentation/devicetree/bindings/pps/pps-gpio.txt
index 40bf9c3..98f8898 100644
--- a/Documentation/devicetree/bindings/pps/pps-gpio.txt
+++ b/Documentation/devicetree/bindings/pps/pps-gpio.txt
@@ -10,6 +10,7 @@ Required properties:
 Optional properties:
 - assert-falling-edge: when present, assert is indicated by a falling edge
                        (instead of by a rising edge)
+- capture-clear: when present, also capture the clear edge
 
 Example:
 	pps {
@@ -17,4 +18,5 @@ Example:
 		gpios = <&gpio2 6 0>;
 
 		assert-falling-edge;
+		capture-clear;
 	};
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 333ad7d..dc4a71c 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -119,6 +119,8 @@ static int pps_gpio_probe(struct platform_device *pdev)
 
 		if (of_get_property(np, "assert-falling-edge", NULL))
 			data->assert_falling_edge = true;
+		if (of_get_property(np, "capture-clear", NULL))
+			data->capture_clear = true;
 	}
 
 	/* GPIO setup */
-- 
2.3.5


             reply	other threads:[~2015-04-02 20:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 19:21 Gary E. Miller [this message]
2015-04-09 13:05 ` [PATCH] PPS: Restore lost capture-clear option to pps-gpio module Jan Lübbe
2015-04-09 19:49   ` Gary E. Miller
2015-04-10  8:15     ` Jan Lübbe
2015-04-10 18:13       ` Gary E. Miller

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=201504022004.t32K4xbW013508@spidey.rellim.com \
    --to=gem@rellim.com \
    --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;
as well as URLs for NNTP newsgroup(s).