pps: add parallel port PPS signal generator
authorAlexander Gordeev <lasaine@lvk.cs.msu.su>
Thu, 13 Jan 2011 01:01:00 +0000 (17:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2011 16:03:21 +0000 (08:03 -0800)
Add PPS signal generator which utilizes STROBE pin of a parallel port to
send PPS signals.  It uses parport abstraction layer and hrtimers to
precisely control the signal.

Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Cc: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/pps/generators/Kconfig
drivers/pps/generators/pps_gen_parport.c

index 5fbd614..f3a73dd 100644 (file)
@@ -2,16 +2,12 @@
 # PPS generators configuration
 #
 
-if PPS
-
 comment "PPS generators support"
 
 config PPS_GENERATOR_PARPORT
        tristate "Parallel port PPS signal generator"
-       depends on PARPORT != n && GENERIC_TIME
+       depends on PARPORT
        help
          If you say yes here you get support for a PPS signal generator which
          utilizes STROBE pin of a parallel port to send PPS signals. It uses
          parport abstraction layer and hrtimers to precisely control the signal.
-
-endif
index a15fe25..5c32f8d 100644 (file)
@@ -76,8 +76,15 @@ static enum hrtimer_restart hrtimer_event(struct hrtimer *timer)
        long lim, delta;
        unsigned long flags;
 
-       /* NB: approx time with blocked interrupts =
-          send_delay + 3 * SAFETY_INTERVAL */
+       /* We have to disable interrupts here. The idea is to prevent
+        * other interrupts on the same processor to introduce random
+        * lags while polling the clock. getnstimeofday() takes <1us on
+        * most machines while other interrupt handlers can take much
+        * more potentially.
+        *
+        * NB: approx time with blocked interrupts =
+        * send_delay + 3 * SAFETY_INTERVAL
+        */
        local_irq_save(flags);
 
        /* first of all we get the time stamp... */