[LinuxPPS] [PATCH v2 1/2] pps: capture-clear documentation & extraction, typo fix

Tom Burkart tom at aussec.com
Wed Sep 26 12:56:35 CEST 2018


This patch adds documentation for the device tree capture-clear option,
device tree capture-clear extraction and a change in error message to
be more explicit.

Signed-off-by: Tom Burkart <tom at aussec.com>
---
 Documentation/devicetree/bindings/pps/pps-gpio.txt | 1 +
 drivers/pps/clients/pps-gpio.c                     | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pps/pps-gpio.txt b/Documentation/devicetree/bindings/pps/pps-gpio.txt
index 3683874832ae..60d3b6e1957d 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 PPS clear event
 
 Example:
 	pps {
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 333ad7d5b45b..78d8fbbb4733 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -119,6 +119,9 @@ 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 */
@@ -131,7 +134,7 @@ static int pps_gpio_probe(struct platform_device *pdev)
 
 	ret = gpio_direction_input(data->gpio_pin);
 	if (ret) {
-		dev_err(&pdev->dev, "failed to set pin direction\n");
+		dev_err(&pdev->dev, "failed to set pin as input\n");
 		return -EINVAL;
 	}
 
-- 
2.12.3




More information about the discussions mailing list