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 <g...@rellim.com>
Fixes: c5dbcf8b70b5 ("pps-gpio: add device-tree binding and support")
Cc: Ricardo Martins <r...@fe.up.pt>
Cc: James Nuss <jamesn...@nanometrics.ca>
Cc: Jan Luebbe <j...@pengutronix.de>
Acked-by: Rodolfo Giometti <giome...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to