linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PPS: Restore lost capture-clear option to pps-gpio module.
@ 2015-04-02 19:21 Gary E. Miller
  2015-04-09 13:05 ` Jan Lübbe
  0 siblings, 1 reply; 5+ messages in thread
From: Gary E. Miller @ 2015-04-02 19:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Gary E. Miller, Rodolfo Giometti, Ricardo Martin s, James Nus s,
	Jan Luebbe

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-10 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 19:21 [PATCH] PPS: Restore lost capture-clear option to pps-gpio module Gary E. Miller
2015-04-09 13:05 ` 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

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).