Advertisement
richardgv

files/fancy-beep-2.6.24-new-kern.patch

May 9th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.22 KB | None | 0 0
  1. --- beep.c  2008-07-31 03:10:54.000000000 +0800
  2. +++ beep.new2.c 2012-05-09 21:04:19.674211872 +0800
  3. @@ -24,7 +24,7 @@
  4.  #include <linux/miscdevice.h>
  5.  #include <asm/uaccess.h>
  6.  #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
  7. -#include <asm/i8253.h>
  8. +#include <linux/i8253.h>
  9.  #else
  10.  #include <asm/8253pit.h>
  11.  static DEFINE_SPINLOCK(i8253_lock);
  12. @@ -165,22 +165,22 @@
  13.        if (value > 20 && value < 32767)
  14.          count = PIT_TICK_RATE / value;
  15.        
  16. -      spin_lock_irqsave(&i8253_lock, flags);
  17. +      raw_spin_lock_irqsave(&i8253_lock, flags);
  18.        
  19.        if (count) {
  20. -        /* enable counter 2 */
  21. -        outb_p(inb_p(0x61) | 3, 0x61);
  22.          /* set command for counter 2, 2 byte write */
  23.          outb_p(0xB6, 0x43);
  24.          /* select desired HZ */
  25.          outb_p(count & 0xff, 0x42);
  26.          outb((count >> 8) & 0xff, 0x42);
  27. +        /* enable counter 2 */
  28. +        outb_p(inb_p(0x61) | 3, 0x61);
  29.        } else {
  30.          /* disable counter 2 */
  31. -       outb(inb_p(0x61) & 0xFC, 0x61);
  32. +        outb(inb_p(0x61) & 0xFC, 0x61);
  33.        }
  34.        
  35. -      spin_unlock_irqrestore(&i8253_lock, flags);
  36. +      raw_spin_unlock_irqrestore(&i8253_lock, flags);
  37.      }
  38.    if (value) {
  39.      what_beep=1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement