git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
media
/
radio
/
radio-typhoon.c
diff --git
a/drivers/media/radio/radio-typhoon.c
b/drivers/media/radio/radio-typhoon.c
index
ea1dbce
..
e509558
100644
(file)
--- a/
drivers/media/radio/radio-typhoon.c
+++ b/
drivers/media/radio/radio-typhoon.c
@@
-31,7
+31,7
@@
#include <linux/module.h> /* Modules */
#include <linux/init.h> /* Initdata */
#include <linux/module.h> /* Modules */
#include <linux/init.h> /* Initdata */
-#include <linux/ioport.h> /*
check_region, request_region
*/
+#include <linux/ioport.h> /*
request_region
*/
#include <linux/proc_fs.h> /* radio card status report */
#include <asm/io.h> /* outb, outb_p */
#include <asm/uaccess.h> /* copy to/from user */
#include <linux/proc_fs.h> /* radio card status report */
#include <asm/io.h> /* outb, outb_p */
#include <asm/uaccess.h> /* copy to/from user */
@@
-59,7
+59,7
@@
struct typhoon_device {
int muted;
unsigned long curfreq;
unsigned long mutefreq;
int muted;
unsigned long curfreq;
unsigned long mutefreq;
- struct
semaphore
lock;
+ struct
mutex
lock;
};
static void typhoon_setvol_generic(struct typhoon_device *dev, int vol);
};
static void typhoon_setvol_generic(struct typhoon_device *dev, int vol);
@@
-77,12
+77,12
@@
static int typhoon_get_info(char *buf, char **start, off_t offset, int len);
static void typhoon_setvol_generic(struct typhoon_device *dev, int vol)
{
static void typhoon_setvol_generic(struct typhoon_device *dev, int vol)
{
-
down
(&dev->lock);
+
mutex_lock
(&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. */
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. */
-
up
(&dev->lock);
+
mutex_unlock
(&dev->lock);
}
static int typhoon_setfreq_generic(struct typhoon_device *dev,
}
static int typhoon_setfreq_generic(struct typhoon_device *dev,
@@
-102,7
+102,7
@@
static int typhoon_setfreq_generic(struct typhoon_device *dev,
*
*/
*
*/
-
down
(&dev->lock);
+
mutex_lock
(&dev->lock);
x = frequency / 160;
outval = (x * x + 2500) / 5000;
outval = (outval * x + 5000) / 10000;
x = frequency / 160;
outval = (x * x + 2500) / 5000;
outval = (outval * x + 5000) / 10000;
@@
-112,7
+112,7
@@
static int typhoon_setfreq_generic(struct typhoon_device *dev,
outb_p((outval >> 8) & 0x01, dev->iobase + 4);
outb_p(outval >> 9, dev->iobase + 6);
outb_p(outval & 0xff, dev->iobase + 8);
outb_p((outval >> 8) & 0x01, dev->iobase + 4);
outb_p(outval >> 9, dev->iobase + 6);
outb_p(outval & 0xff, dev->iobase + 8);
-
up
(&dev->lock);
+
mutex_unlock
(&dev->lock);
return 0;
}
return 0;
}
@@
-261,6
+261,7
@@
static struct file_operations typhoon_fops = {
.open = video_exclusive_open,
.release = video_exclusive_release,
.ioctl = typhoon_ioctl,
.open = video_exclusive_open,
.release = video_exclusive_release,
.ioctl = typhoon_ioctl,
+ .compat_ioctl = v4l_compat_ioctl32,
.llseek = no_llseek,
};
.llseek = no_llseek,
};
@@
-305,17
+306,17
@@
MODULE_AUTHOR("Dr. Henrik Seidel");
MODULE_DESCRIPTION("A driver for the Typhoon radio card (a.k.a. EcoRadio).");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("A driver for the Typhoon radio card (a.k.a. EcoRadio).");
MODULE_LICENSE("GPL");
-MODULE_PARM(io, "i");
-MODULE_PARM_DESC(io, "I/O address of the Typhoon card (0x316 or 0x336)");
-MODULE_PARM(mutefreq, "i");
-MODULE_PARM_DESC(mutefreq, "Frequency used when muting the card (in kHz)");
-MODULE_PARM(radio_nr, "i");
-
static int io = -1;
static int radio_nr = -1;
static int io = -1;
static int radio_nr = -1;
+module_param(io, int, 0);
+MODULE_PARM_DESC(io, "I/O address of the Typhoon card (0x316 or 0x336)");
+module_param(radio_nr, int, 0);
+
#ifdef MODULE
static unsigned long mutefreq = 0;
#ifdef MODULE
static unsigned long mutefreq = 0;
+module_param(mutefreq, ulong, 0);
+MODULE_PARM_DESC(mutefreq, "Frequency used when muting the card (in kHz)");
#endif
static int __init typhoon_init(void)
#endif
static int __init typhoon_init(void)
@@
-336,7
+337,7
@@
static int __init typhoon_init(void)
#endif /* MODULE */
printk(KERN_INFO BANNER);
#endif /* MODULE */
printk(KERN_INFO BANNER);
-
init_MUTEX
(&typhoon_unit.lock);
+
mutex_init
(&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",
io = typhoon_unit.iobase;
if (!request_region(io, 8, "typhoon")) {
printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",