ALSA: Fix PIT lockup on some chipsets when using the PC-Speaker
authorZoltan Devai <zdevai@gmail.com>
Sun, 2 Nov 2008 23:30:28 +0000 (00:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 3 Nov 2008 07:57:25 +0000 (08:57 +0100)
Fix PIT lockup on some chipsets when using the PC-Speaker.

Signed-off-by: Zoltan Devai <zdevai@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/pcsp/pcsp_input.c

index cd9b83e7f7d136c1e8dc078b3aa8fa222fabb940..0444cdeb4becd93a35f8fe20ad6699e2c0a8e9f7 100644 (file)
@@ -24,13 +24,13 @@ static void pcspkr_do_sound(unsigned int count)
        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);