int muted;
unsigned long curfreq;
unsigned long mutefreq;
- struct mutex lock;
+ struct semaphore lock;
};
static void typhoon_setvol_generic(struct typhoon_device *dev, int vol);
static void typhoon_setvol_generic(struct typhoon_device *dev, int vol)
{
- mutex_lock(&dev->lock);
+ down(&dev->lock);
vol >>= 14; /* Map 16 bit to 2 bit */
vol &= 3;
outb_p(vol / 2, dev->iobase); /* Set the volume, high bit. */
outb_p(vol % 2, dev->iobase + 2); /* Set the volume, low bit. */
- mutex_unlock(&dev->lock);
+ up(&dev->lock);
}
static int typhoon_setfreq_generic(struct typhoon_device *dev,
*
*/
- mutex_lock(&dev->lock);
+ down(&dev->lock);
x = frequency / 160;
outval = (x * x + 2500) / 5000;
outval = (outval * x + 5000) / 10000;
outb_p((outval >> 8) & 0x01, dev->iobase + 4);
outb_p(outval >> 9, dev->iobase + 6);
outb_p(outval & 0xff, dev->iobase + 8);
- mutex_unlock(&dev->lock);
+ up(&dev->lock);
return 0;
}
#endif /* MODULE */
printk(KERN_INFO BANNER);
- mutex_init(&typhoon_unit.lock);
+ init_MUTEX(&typhoon_unit.lock);
io = typhoon_unit.iobase;
if (!request_region(io, 8, "typhoon")) {
printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",