summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-3.12.27/linux-3.12-pps-gpio.patch
blob: ff30650d70427783c9d59c9717e9429dee9d2d9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
#  Author:  Gary Miller
#  https://groups.google.com/forum/#!topic/linux.kernel/fj1NGMrfGW8
#
#  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. 
#
====================================================================
diff -uprN old/Documentation/devicetree/bindings/pps/pps-gpio.txt new/Documentation/devicetree/bindings/pps/pps-gpio.txt
--- old/Documentation/devicetree/bindings/pps/pps-gpio.txt	2016-09-16 18:22:31.149632690 -0500
+++ new/Documentation/devicetree/bindings/pps/pps-gpio.txt	2016-09-16 18:27:02.981632115 -0500
@@ -17,4 +17,5 @@ Example:
 		gpios = <&gpio2 6 0>;
 
 		assert-falling-edge;
+		capture-clear;
 	};
diff -uprN old/drivers/pps/clients/pps-gpio.c new/drivers/pps/clients/pps-gpio.c
--- old/drivers/pps/clients/pps-gpio.c	2016-09-16 18:23:45.661632532 -0500
+++ new/drivers/pps/clients/pps-gpio.c	2016-09-16 18:29:20.257631825 -0500
@@ -119,6 +119,8 @@ static int pps_gpio_probe(struct platfor
 
 		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 */