lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201504022004.t32K4xbW013508@spidey.rellim.com>
Date:	Thu, 2 Apr 2015 12:21:43 -0700
From:	"Gary E. Miller" <gem@...lim.com>
To:	linux-kernel@...r.kernel.org
Cc:	"Jan Luebbe" <jlu@...gutronix.de>
Subject: [PATCH] PPS: Restore lost capture-clear option to pps-gpio module.

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@...lim.com>
Fixes: c5dbcf8b70b5 ("pps-gpio: add device-tree binding and support")
Cc: Ricardo Martins <rasm@...up.pt>
Cc: James Nuss <jamesnuss@...ometrics.ca>
Cc: Jan Luebbe <jlu@...gutronix.de>
Acked-by: Rodolfo Giometti <giometti@...ux.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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ