aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-sf16fmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/radio/radio-sf16fmi.c')
-rw-r--r--drivers/media/radio/radio-sf16fmi.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 0229f792a059..53073b424107 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -24,7 +24,7 @@
24#include <linux/isapnp.h> 24#include <linux/isapnp.h>
25#include <asm/io.h> /* outb, outb_p */ 25#include <asm/io.h> /* outb, outb_p */
26#include <asm/uaccess.h> /* copy to/from user */ 26#include <asm/uaccess.h> /* copy to/from user */
27#include <asm/semaphore.h> 27#include <linux/mutex.h>
28 28
29struct fmi_device 29struct fmi_device
30{ 30{
@@ -37,7 +37,7 @@ struct fmi_device
37static int io = -1; 37static int io = -1;
38static int radio_nr = -1; 38static int radio_nr = -1;
39static struct pnp_dev *dev = NULL; 39static struct pnp_dev *dev = NULL;
40static struct semaphore lock; 40static struct mutex lock;
41 41
42/* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */ 42/* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */
43/* It is only useful to give freq in intervall of 800 (=0.05Mhz), 43/* It is only useful to give freq in intervall of 800 (=0.05Mhz),
@@ -68,16 +68,16 @@ static void outbits(int bits, unsigned int data, int port)
68 68
69static inline void fmi_mute(int port) 69static inline void fmi_mute(int port)
70{ 70{
71 down(&lock); 71 mutex_lock(&lock);
72 outb(0x00, port); 72 outb(0x00, port);
73 up(&lock); 73 mutex_unlock(&lock);
74} 74}
75 75
76static inline void fmi_unmute(int port) 76static inline void fmi_unmute(int port)
77{ 77{
78 down(&lock); 78 mutex_lock(&lock);
79 outb(0x08, port); 79 outb(0x08, port);
80 up(&lock); 80 mutex_unlock(&lock);
81} 81}
82 82
83static inline int fmi_setfreq(struct fmi_device *dev) 83static inline int fmi_setfreq(struct fmi_device *dev)
@@ -85,12 +85,12 @@ static inline int fmi_setfreq(struct fmi_device *dev)
85 int myport = dev->port; 85 int myport = dev->port;
86 unsigned long freq = dev->curfreq; 86 unsigned long freq = dev->curfreq;
87 87
88 down(&lock); 88 mutex_lock(&lock);
89 89
90 outbits(16, RSF16_ENCODE(freq), myport); 90 outbits(16, RSF16_ENCODE(freq), myport);
91 outbits(8, 0xC0, myport); 91 outbits(8, 0xC0, myport);
92 msleep(143); /* was schedule_timeout(HZ/7) */ 92 msleep(143); /* was schedule_timeout(HZ/7) */
93 up(&lock); 93 mutex_unlock(&lock);
94 if (dev->curvol) fmi_unmute(myport); 94 if (dev->curvol) fmi_unmute(myport);
95 return 0; 95 return 0;
96} 96}
@@ -102,7 +102,7 @@ static inline int fmi_getsigstr(struct fmi_device *dev)
102 int myport = dev->port; 102 int myport = dev->port;
103 103
104 104
105 down(&lock); 105 mutex_lock(&lock);
106 val = dev->curvol ? 0x08 : 0x00; /* unmute/mute */ 106 val = dev->curvol ? 0x08 : 0x00; /* unmute/mute */
107 outb(val, myport); 107 outb(val, myport);
108 outb(val | 0x10, myport); 108 outb(val | 0x10, myport);
@@ -110,7 +110,7 @@ static inline int fmi_getsigstr(struct fmi_device *dev)
110 res = (int)inb(myport+1); 110 res = (int)inb(myport+1);
111 outb(val, myport); 111 outb(val, myport);
112 112
113 up(&lock); 113 mutex_unlock(&lock);
114 return (res & 2) ? 0 : 0xFFFF; 114 return (res & 2) ? 0 : 0xFFFF;
115} 115}
116 116
@@ -296,7 +296,7 @@ static int __init fmi_init(void)
296 fmi_unit.flags = VIDEO_TUNER_LOW; 296 fmi_unit.flags = VIDEO_TUNER_LOW;
297 fmi_radio.priv = &fmi_unit; 297 fmi_radio.priv = &fmi_unit;
298 298
299 init_MUTEX(&lock); 299 mutex_init(&lock);
300 300
301 if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) == -1) { 301 if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) == -1) {
302 release_region(io, 2); 302 release_region(io, 2);