summaryrefslogtreecommitdiff
path: root/drivers/pps/clients/pps-gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pps/clients/pps-gpio.c')
-rw-r--r--drivers/pps/clients/pps-gpio.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 333ad7d5b45b..6dd425abc5a5 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -44,6 +44,7 @@ struct pps_gpio_device_data {
bool assert_falling_edge;
bool capture_clear;
unsigned int gpio_pin;
+ bool use_system_time_ts;
};
/*
@@ -56,11 +57,14 @@ static irqreturn_t pps_gpio_irq_handler(int irq, void *data)
struct pps_event_time ts;
int rising_edge;
- /* Get the time stamp first */
- pps_get_ts(&ts);
-
info = data;
+ /* Get the time stamp first */
+ if (!info->use_system_time_ts)
+ get_monotonic_boottime(&ts.ts_real);
+ else
+ pps_get_ts(&ts);
+
rising_edge = gpio_get_value(info->gpio_pin);
if ((rising_edge && !info->assert_falling_edge) ||
(!rising_edge && info->assert_falling_edge))
@@ -119,6 +123,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, "use-system-time-ts", NULL))
+ data->use_system_time_ts = true;
}
/* GPIO setup */