---
arch/arm/boot/dts/overlays/pps-gpio-overlay.dts | 13 ++++++++-----
drivers/pps/clients/pps-gpio.c | 26 ++++++++++++++-----------
include/linux/pps-gpio.h | 1 +
3 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts b/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
index 9ee4bdfa6167..06e6cf5fc6ea 100644
--- a/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
+++ b/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
@@ -10,7 +10,8 @@
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&pps_pins>;
- gpios = <&gpio 18 0>;
+ in-gpios = <&gpio 18 0>;
+ out-gpios = <&gpio 17 0>;
status = "okay";
};
};
@@ -20,18 +21,20 @@
target = <&gpio>;
__overlay__ {
pps_pins: pps_pins@12 {
- brcm,pins = <18>;
- brcm,function = <0>; // in
- brcm,pull = <0>; // off
+ brcm,pins = <18 17>;
+ brcm,function = <0 1>; // in out
+ brcm,pull = <0 0>; // off off
};
};
};
__overrides__ {
- gpiopin = <&pps>,"gpios:4",
+ gpiopin = <&pps>,"in-gpios:4",
<&pps>,"reg:0",
<&pps_pins>,"brcm,pins:0",
<&pps_pins>,"reg:0";
+ echopin = <&pps>,"out-gpios:4",
+ <&pps_pins>,"brcm,pins:4";
assert_falling_edge = <&pps>,"assert-falling-edge?";
};
};
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 35c3b14fc9b9..ce3065889a7e 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -37,10 +37,6 @@
#include <linux/of_gpio.h>
#include <linux/delay.h>
-/* TODO: this should work like gpio_pin below but I don't know how to work with
- * devicetree overlays.
- */
-#define PPS_GPIO_ECHO_PIN 17