diff options
Diffstat (limited to 'drivers/input/misc/pcspkr.c')
-rw-r--r-- | drivers/input/misc/pcspkr.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index 31989dcd922c..c19f77fbaf2a 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c | |||
@@ -17,14 +17,20 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/input.h> | 18 | #include <linux/input.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <asm/8253pit.h> | ||
21 | #include <asm/io.h> | 20 | #include <asm/io.h> |
22 | 21 | ||
23 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | 22 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
24 | MODULE_DESCRIPTION("PC Speaker beeper driver"); | 23 | MODULE_DESCRIPTION("PC Speaker beeper driver"); |
25 | MODULE_LICENSE("GPL"); | 24 | MODULE_LICENSE("GPL"); |
25 | MODULE_ALIAS("platform:pcspkr"); | ||
26 | 26 | ||
27 | static DEFINE_SPINLOCK(i8253_beep_lock); | 27 | #ifdef CONFIG_X86 |
28 | /* Use the global PIT lock ! */ | ||
29 | #include <asm/i8253.h> | ||
30 | #else | ||
31 | #include <asm/8253pit.h> | ||
32 | static DEFINE_SPINLOCK(i8253_lock); | ||
33 | #endif | ||
28 | 34 | ||
29 | static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 35 | static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) |
30 | { | 36 | { |
@@ -43,7 +49,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c | |||
43 | if (value > 20 && value < 32767) | 49 | if (value > 20 && value < 32767) |
44 | count = PIT_TICK_RATE / value; | 50 | count = PIT_TICK_RATE / value; |
45 | 51 | ||
46 | spin_lock_irqsave(&i8253_beep_lock, flags); | 52 | spin_lock_irqsave(&i8253_lock, flags); |
47 | 53 | ||
48 | if (count) { | 54 | if (count) { |
49 | /* enable counter 2 */ | 55 | /* enable counter 2 */ |
@@ -58,7 +64,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c | |||
58 | outb(inb_p(0x61) & 0xFC, 0x61); | 64 | outb(inb_p(0x61) & 0xFC, 0x61); |
59 | } | 65 | } |
60 | 66 | ||
61 | spin_unlock_irqrestore(&i8253_beep_lock, flags); | 67 | spin_unlock_irqrestore(&i8253_lock, flags); |
62 | 68 | ||
63 | return 0; | 69 | return 0; |
64 | } | 70 | } |