]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
time: move PIT_TICK_RATE to linux/timex.h
authorArnd Bergmann <arnd@arndb.de>
Tue, 16 Jun 2009 22:31:12 +0000 (15:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Jun 2009 02:47:27 +0000 (19:47 -0700)
PIT_TICK_RATE is currently defined in four architectures, but in three
different places.  While linux/timex.h is not the perfect place for it, it
is still a reasonable replacement for those drivers that traditionally use
asm/timex.h to get CLOCK_TICK_RATE and expect it to be the PIT frequency.

Note that for Alpha, the actual value changed from 1193182UL to 1193180UL.
 This is unlikely to make a difference, and probably can only improve
accuracy.  There was a discussion on the correct value of CLOCK_TICK_RATE
a few years ago, after which every existing instance was getting changed
to 1193182.  According to the specification, it should be
1193181.818181...

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Len Brown <lenb@kernel.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 files changed:
arch/alpha/include/asm/8253pit.h
arch/alpha/kernel/sys_ruffian.c
arch/mips/include/asm/i8253.h
arch/powerpc/include/asm/8253pit.h
arch/x86/include/asm/timex.h
arch/x86/kernel/i8253.c
arch/x86/kernel/tsc.c
drivers/clocksource/acpi_pm.c
drivers/input/joystick/analog.c
drivers/input/misc/pcspkr.c
include/linux/timex.h
sound/drivers/pcsp/pcsp.h
sound/oss/pas2_pcm.c

index fef5c1450e471643968802394079689f95213fc9..a71c9c1455a722fed428bb89d0c2b677b7a7087e 100644 (file)
@@ -1,10 +1,3 @@
 /*
  * 8253/8254 Programmable Interval Timer
  */
-
-#ifndef _8253PIT_H
-#define _8253PIT_H
-
-#define PIT_TICK_RATE  1193180UL
-
-#endif
index f15a329b6011167791b6baf2f898de662a5fb1d1..d9f9cfeb9931354cee9d6df304877941ef13ecea 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
+#include <linux/timex.h>
 #include <linux/init.h>
 
 #include <asm/ptrace.h>
index 5dabc870b32295779a6d2a93bbed0d90ac6a1f90..032ca73f181bec27c0f7b741862ada66ec104342 100644 (file)
@@ -12,8 +12,6 @@
 #define PIT_CH0                        0x40
 #define PIT_CH2                        0x42
 
-#define PIT_TICK_RATE          1193182UL
-
 extern spinlock_t i8253_lock;
 
 extern void setup_pit_timer(void);
index b70d6e53b303519a7e22ae6eb43e28be6dbd2f4b..a71c9c1455a722fed428bb89d0c2b677b7a7087e 100644 (file)
@@ -1,10 +1,3 @@
-#ifndef _ASM_POWERPC_8253PIT_H
-#define _ASM_POWERPC_8253PIT_H
-
 /*
  * 8253/8254 Programmable Interval Timer
  */
-
-#define PIT_TICK_RATE  1193182UL
-
-#endif /* _ASM_POWERPC_8253PIT_H */
index b5c9d45c981fa7a51b9429aff281a9a595fcb370..1375cfc93960e1054dcaa3d8a7f41cacaaee028a 100644 (file)
@@ -4,9 +4,7 @@
 #include <asm/processor.h>
 #include <asm/tsc.h>
 
-/* The PIT ticks at this frequency (in HZ): */
-#define PIT_TICK_RATE          1193182
-
+/* Assume we use the PIT time source for the clock tick */
 #define CLOCK_TICK_RATE                PIT_TICK_RATE
 
 #define ARCH_HAS_READ_CURRENT_TIMER
index c2e0bb0890d4a17d652f1710a4df8ab948dec7a5..5cf36c053ac401a08a9e1ced6679e7f59c09d782 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/spinlock.h>
 #include <linux/jiffies.h>
 #include <linux/module.h>
+#include <linux/timex.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/io.h>
index 3e1c057e98fe039325eed2056d8960fa52f023c4..ae3180c506a6ba47163ff621b46b1814f55cdd8e 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/delay.h>
 #include <linux/clocksource.h>
 #include <linux/percpu.h>
+#include <linux/timex.h>
 
 #include <asm/hpet.h>
 #include <asm/timer.h>
index 40bd8c61c7d7c5ead10f794ad52b1250bf9e33bd..72a633a6ec982e74153235e8f015ddba65d84af4 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/acpi_pmtmr.h>
 #include <linux/clocksource.h>
+#include <linux/timex.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/pci.h>
index 356b3a25efa24c4568a909c59dedaa7ebcbc040c..1c0b529c06aaa596b8fe4a663cd275ed4f39ead6 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/input.h>
 #include <linux/gameport.h>
 #include <linux/jiffies.h>
-#include <asm/timex.h>
+#include <linux/timex.h>
 
 #define DRIVER_DESC    "Analog joystick and gamepad driver"
 
index d6a30cee7bc79b63f5ed124d48dc36ac55bd9e05..6d67af5387adcfdff514133ca9f1ce9d0bf39f8b 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
+#include <linux/timex.h>
 #include <asm/io.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
index 9910e3bd5b316918466359ca20ae3a88914892bd..e6967d10d9e5ea39f77efecca64c59beb9d009d5 100644 (file)
@@ -280,6 +280,9 @@ extern int do_adjtimex(struct timex *);
 
 int read_current_timer(unsigned long *timer_val);
 
+/* The clock frequency of the i8253/i8254 PIT */
+#define PIT_TICK_RATE 1193182ul
+
 #endif /* KERNEL */
 
 #endif /* LINUX_TIMEX_H */
index cdef2664218ff7c27582d49d0a987bcc2f65d030..174dd2ff0f22ceec380458349ca099681e1d35ab 100644 (file)
@@ -10,6 +10,7 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
+#include <linux/timex.h>
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
 #include <asm/i8253.h>
index 36c3ea62086be882dbba7d630643b2f6ea110978..8f7d175767a21e75b5167bf7eb117295bef3d250 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <linux/init.h>
 #include <linux/spinlock.h>
-#include <asm/timex.h>
+#include <linux/timex.h>
 #include "sound_config.h"
 
 #include "pas2.h"