diff options
author | Alexander Gordeev <lasaine@lvk.cs.msu.su> | 2011-01-12 20:01:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:21 -0500 |
commit | 563558b2c7350371551bf08348ac61be62200505 (patch) | |
tree | e7f767bf68efd16a8784c8875d885ba6ea9ecf6d /drivers | |
parent | 46b402a0e5e4b4d81b11c32dfb2312bf5828ecb5 (diff) |
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 <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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pps/generators/Kconfig | 6 | ||||
-rw-r--r-- | drivers/pps/generators/pps_gen_parport.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/pps/generators/Kconfig b/drivers/pps/generators/Kconfig index 5fbd6148c804..f3a73dd77660 100644 --- a/drivers/pps/generators/Kconfig +++ b/drivers/pps/generators/Kconfig | |||
@@ -2,16 +2,12 @@ | |||
2 | # PPS generators configuration | 2 | # PPS generators configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | if PPS | ||
6 | |||
7 | comment "PPS generators support" | 5 | comment "PPS generators support" |
8 | 6 | ||
9 | config PPS_GENERATOR_PARPORT | 7 | config PPS_GENERATOR_PARPORT |
10 | tristate "Parallel port PPS signal generator" | 8 | tristate "Parallel port PPS signal generator" |
11 | depends on PARPORT != n && GENERIC_TIME | 9 | depends on PARPORT |
12 | help | 10 | help |
13 | If you say yes here you get support for a PPS signal generator which | 11 | If you say yes here you get support for a PPS signal generator which |
14 | utilizes STROBE pin of a parallel port to send PPS signals. It uses | 12 | utilizes STROBE pin of a parallel port to send PPS signals. It uses |
15 | parport abstraction layer and hrtimers to precisely control the signal. | 13 | parport abstraction layer and hrtimers to precisely control the signal. |
16 | |||
17 | endif | ||
diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c index a15fe25efd55..5c32f8dacf56 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) | |||
76 | long lim, delta; | 76 | long lim, delta; |
77 | unsigned long flags; | 77 | unsigned long flags; |
78 | 78 | ||
79 | /* NB: approx time with blocked interrupts = | 79 | /* We have to disable interrupts here. The idea is to prevent |
80 | send_delay + 3 * SAFETY_INTERVAL */ | 80 | * other interrupts on the same processor to introduce random |
81 | * lags while polling the clock. getnstimeofday() takes <1us on | ||
82 | * most machines while other interrupt handlers can take much | ||
83 | * more potentially. | ||
84 | * | ||
85 | * NB: approx time with blocked interrupts = | ||
86 | * send_delay + 3 * SAFETY_INTERVAL | ||
87 | */ | ||
81 | local_irq_save(flags); | 88 | local_irq_save(flags); |
82 | 89 | ||
83 | /* first of all we get the time stamp... */ | 90 | /* first of all we get the time stamp... */ |