]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/input/misc/pcspkr.c
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
[linux-2.6-omap-h63xx.git] / drivers / input / misc / pcspkr.c
index c19f77fbaf2a9ffb7646f03bfcb8493797830f93..d6a30cee7bc79b63f5ed124d48dc36ac55bd9e05 100644 (file)
@@ -24,7 +24,7 @@ MODULE_DESCRIPTION("PC Speaker beeper driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#ifdef CONFIG_X86
+#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
 #include <asm/i8253.h>
 #else
@@ -52,13 +52,13 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
        spin_lock_irqsave(&i8253_lock, flags);
 
        if (count) {
-               /* enable counter 2 */
-               outb_p(inb_p(0x61) | 3, 0x61);
                /* set command for counter 2, 2 byte write */
                outb_p(0xB6, 0x43);
                /* select desired HZ */
                outb_p(count & 0xff, 0x42);
                outb((count >> 8) & 0xff, 0x42);
+               /* enable counter 2 */
+               outb_p(inb_p(0x61) | 3, 0x61);
        } else {
                /* disable counter 2 */
                outb(inb_p(0x61) & 0xFC, 0x61);
@@ -86,8 +86,8 @@ static int __devinit pcspkr_probe(struct platform_device *dev)
        pcspkr_dev->id.version = 0x0100;
        pcspkr_dev->dev.parent = &dev->dev;
 
-       pcspkr_dev->evbit[0] = BIT(EV_SND);
-       pcspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+       pcspkr_dev->evbit[0] = BIT_MASK(EV_SND);
+       pcspkr_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
        pcspkr_dev->event = pcspkr_event;
 
        err = input_register_device(pcspkr_dev);