]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/input/misc/pcspkr.c
platform: prefix MODALIAS with "platform:"
[linux-2.6-omap-h63xx.git] / drivers / input / misc / pcspkr.c
index afd322185bbff65e20e055f7310bc64228d7f61f..e1a44020ed2b456292685e13b14253fd56f734a0 100644 (file)
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("PC Speaker beeper driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:pcspkr");
 
-static DEFINE_SPINLOCK(i8253_beep_lock);
+#ifdef CONFIG_X86
+/* Use the global PIT lock ! */
+#include <asm/i8253.h>
+#else
+static DEFINE_SPINLOCK(i8253_lock);
+#endif
 
 static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
@@ -43,7 +49,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
        if (value > 20 && value < 32767)
                count = PIT_TICK_RATE / value;
 
-       spin_lock_irqsave(&i8253_beep_lock, flags);
+       spin_lock_irqsave(&i8253_lock, flags);
 
        if (count) {
                /* enable counter 2 */
@@ -58,7 +64,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
                outb(inb_p(0x61) & 0xFC, 0x61);
        }
 
-       spin_unlock_irqrestore(&i8253_beep_lock, flags);
+       spin_unlock_irqrestore(&i8253_lock, flags);
 
        return 0;
 }
@@ -78,7 +84,7 @@ static int __devinit pcspkr_probe(struct platform_device *dev)
        pcspkr_dev->id.vendor = 0x001f;
        pcspkr_dev->id.product = 0x0001;
        pcspkr_dev->id.version = 0x0100;
-       pcspkr_dev->cdev.dev = &dev->dev;
+       pcspkr_dev->dev.parent = &dev->dev;
 
        pcspkr_dev->evbit[0] = BIT(EV_SND);
        pcspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);