From 563558b2c7350371551bf08348ac61be62200505 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Wed, 12 Jan 2011 17:01:00 -0800 Subject: pps: add parallel port PPS signal generator 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 Cc: Rodolfo Giometti Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pps/generators/Kconfig | 6 +----- drivers/pps/generators/pps_gen_parport.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/pps/generators/Kconfig b/drivers/pps/generators/Kconfig index 5fbd6148c80..f3a73dd7766 100644 --- a/drivers/pps/generators/Kconfig +++ b/drivers/pps/generators/Kconfig @@ -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 diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c index a15fe25efd5..5c32f8dacf5 100644 --- a/drivers/pps/generators/pps_gen_parport.c +++ b/drivers/pps/generators/pps_gen_parport.c @@ -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... */ -- cgit v1.2.3-18-g5258