Commit 52161621 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] CLOCK_TICK_RATE: use PIT_TICK_RATE in *spkr.c

From: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
parent 80c44e42
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/sysdev.h> #include <linux/sysdev.h>
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <asm/8253pit.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/vsyscall.h> #include <asm/vsyscall.h>
#include <asm/timex.h> #include <asm/timex.h>
...@@ -54,7 +55,7 @@ static int nohpet __initdata = 0; ...@@ -54,7 +55,7 @@ static int nohpet __initdata = 0;
unsigned int cpu_khz; /* TSC clocks / usec, not used here */ unsigned int cpu_khz; /* TSC clocks / usec, not used here */
unsigned long hpet_period; /* fsecs / HPET clock */ unsigned long hpet_period; /* fsecs / HPET clock */
unsigned long hpet_tick; /* HPET clocks / interrupt */ unsigned long hpet_tick; /* HPET clocks / interrupt */
unsigned long vxtime_hz = 1193182; unsigned long vxtime_hz = PIT_TICK_RATE;
int report_lost_ticks; /* command line option */ int report_lost_ticks; /* command line option */
unsigned long long monotonic_base; unsigned long long monotonic_base;
...@@ -600,8 +601,8 @@ static unsigned int __init pit_calibrate_tsc(void) ...@@ -600,8 +601,8 @@ static unsigned int __init pit_calibrate_tsc(void)
outb((inb(0x61) & ~0x02) | 0x01, 0x61); outb((inb(0x61) & ~0x02) | 0x01, 0x61);
outb(0xb0, 0x43); outb(0xb0, 0x43);
outb((1193182 / (1000 / 50)) & 0xff, 0x42); outb((PIT_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
outb((1193182 / (1000 / 50)) >> 8, 0x42); outb((PIT_TICK_RATE / (1000 / 50)) >> 8, 0x42);
rdtscll(start); rdtscll(start);
sync_core(); sync_core();
while ((inb(0x61) & 0x20) == 0); while ((inb(0x61) & 0x20) == 0);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/input.h> #include <linux/input.h>
#include <asm/8253pit.h>
#include <asm/io.h> #include <asm/io.h>
MODULE_AUTHOR("Osamu Tomita <tomita@cinet.co.jp>"); MODULE_AUTHOR("Osamu Tomita <tomita@cinet.co.jp>");
...@@ -44,7 +45,7 @@ static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -44,7 +45,7 @@ static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int c
} }
if (value > 20 && value < 32767) if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value; count = PIT_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags); spin_lock_irqsave(&i8253_beep_lock, flags);
......
...@@ -14,7 +14,7 @@ config INPUT_MISC ...@@ -14,7 +14,7 @@ config INPUT_MISC
config INPUT_PCSPKR config INPUT_PCSPKR
tristate "PC Speaker support" tristate "PC Speaker support"
depends on INPUT && INPUT_MISC depends on (ALPHA || X86 || X86_64 || MIPS) && INPUT && INPUT_MISC
help help
Say Y here if you want the standard PC Speaker to be used for Say Y here if you want the standard PC Speaker to be used for
bells and whistles. bells and whistles.
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/input.h> #include <linux/input.h>
#include <asm/8253pit.h>
#include <asm/io.h> #include <asm/io.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
...@@ -43,7 +44,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -43,7 +44,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
} }
if (value > 20 && value < 32767) if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value; count = PIT_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags); spin_lock_irqsave(&i8253_beep_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment