Loading Documentation/devicetree/bindings/pps/pps-gpio.txt +3 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,9 @@ Required properties: Optional properties: - assert-falling-edge: when present, assert is indicated by a falling edge (instead of by a rising edge) - use-system-time-ts: use the system time via pps_get_ts as the timestamp if this is not defined then the timestamp will come from the monotonic boot time Example: pps { Loading drivers/pps/clients/pps-gpio.c +10 −3 Original line number Diff line number Diff line Loading @@ -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; }; /* Loading @@ -56,10 +57,13 @@ static irqreturn_t pps_gpio_irq_handler(int irq, void *data) struct pps_event_time ts; int rising_edge; info = data; /* Get the time stamp first */ if (!info->use_system_time_ts) get_monotonic_boottime(&ts.ts_real); info = data; else pps_get_ts(&ts); rising_edge = gpio_get_value(info->gpio_pin); if ((rising_edge && !info->assert_falling_edge) || Loading Loading @@ -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 */ Loading Loading
Documentation/devicetree/bindings/pps/pps-gpio.txt +3 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,9 @@ Required properties: Optional properties: - assert-falling-edge: when present, assert is indicated by a falling edge (instead of by a rising edge) - use-system-time-ts: use the system time via pps_get_ts as the timestamp if this is not defined then the timestamp will come from the monotonic boot time Example: pps { Loading
drivers/pps/clients/pps-gpio.c +10 −3 Original line number Diff line number Diff line Loading @@ -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; }; /* Loading @@ -56,10 +57,13 @@ static irqreturn_t pps_gpio_irq_handler(int irq, void *data) struct pps_event_time ts; int rising_edge; info = data; /* Get the time stamp first */ if (!info->use_system_time_ts) get_monotonic_boottime(&ts.ts_real); info = data; else pps_get_ts(&ts); rising_edge = gpio_get_value(info->gpio_pin); if ((rising_edge && !info->assert_falling_edge) || Loading Loading @@ -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 */ Loading