diff options
Diffstat (limited to 'drivers/media/radio/radio-zoltrix.c')
-rw-r--r-- | drivers/media/radio/radio-zoltrix.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index d590e80c922e..7bf1a4264891 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c | |||
@@ -48,7 +48,7 @@ struct zol_device { | |||
48 | unsigned long curfreq; | 48 | unsigned long curfreq; |
49 | int muted; | 49 | int muted; |
50 | unsigned int stereo; | 50 | unsigned int stereo; |
51 | struct semaphore lock; | 51 | struct mutex lock; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | static int zol_setvol(struct zol_device *dev, int vol) | 54 | static int zol_setvol(struct zol_device *dev, int vol) |
@@ -57,30 +57,30 @@ static int zol_setvol(struct zol_device *dev, int vol) | |||
57 | if (dev->muted) | 57 | if (dev->muted) |
58 | return 0; | 58 | return 0; |
59 | 59 | ||
60 | down(&dev->lock); | 60 | mutex_lock(&dev->lock); |
61 | if (vol == 0) { | 61 | if (vol == 0) { |
62 | outb(0, io); | 62 | outb(0, io); |
63 | outb(0, io); | 63 | outb(0, io); |
64 | inb(io + 3); /* Zoltrix needs to be read to confirm */ | 64 | inb(io + 3); /* Zoltrix needs to be read to confirm */ |
65 | up(&dev->lock); | 65 | mutex_unlock(&dev->lock); |
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | 68 | ||
69 | outb(dev->curvol-1, io); | 69 | outb(dev->curvol-1, io); |
70 | msleep(10); | 70 | msleep(10); |
71 | inb(io + 2); | 71 | inb(io + 2); |
72 | up(&dev->lock); | 72 | mutex_unlock(&dev->lock); |
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | static void zol_mute(struct zol_device *dev) | 76 | static void zol_mute(struct zol_device *dev) |
77 | { | 77 | { |
78 | dev->muted = 1; | 78 | dev->muted = 1; |
79 | down(&dev->lock); | 79 | mutex_lock(&dev->lock); |
80 | outb(0, io); | 80 | outb(0, io); |
81 | outb(0, io); | 81 | outb(0, io); |
82 | inb(io + 3); /* Zoltrix needs to be read to confirm */ | 82 | inb(io + 3); /* Zoltrix needs to be read to confirm */ |
83 | up(&dev->lock); | 83 | mutex_unlock(&dev->lock); |
84 | } | 84 | } |
85 | 85 | ||
86 | static void zol_unmute(struct zol_device *dev) | 86 | static void zol_unmute(struct zol_device *dev) |
@@ -104,7 +104,7 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq) | |||
104 | bitmask = 0xc480402c10080000ull; | 104 | bitmask = 0xc480402c10080000ull; |
105 | i = 45; | 105 | i = 45; |
106 | 106 | ||
107 | down(&dev->lock); | 107 | mutex_lock(&dev->lock); |
108 | 108 | ||
109 | outb(0, io); | 109 | outb(0, io); |
110 | outb(0, io); | 110 | outb(0, io); |
@@ -149,7 +149,7 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq) | |||
149 | udelay(1000); | 149 | udelay(1000); |
150 | } | 150 | } |
151 | 151 | ||
152 | up(&dev->lock); | 152 | mutex_unlock(&dev->lock); |
153 | 153 | ||
154 | if(!dev->muted) | 154 | if(!dev->muted) |
155 | { | 155 | { |
@@ -164,7 +164,7 @@ static int zol_getsigstr(struct zol_device *dev) | |||
164 | { | 164 | { |
165 | int a, b; | 165 | int a, b; |
166 | 166 | ||
167 | down(&dev->lock); | 167 | mutex_lock(&dev->lock); |
168 | outb(0x00, io); /* This stuff I found to do nothing */ | 168 | outb(0x00, io); /* This stuff I found to do nothing */ |
169 | outb(dev->curvol, io); | 169 | outb(dev->curvol, io); |
170 | msleep(20); | 170 | msleep(20); |
@@ -173,7 +173,7 @@ static int zol_getsigstr(struct zol_device *dev) | |||
173 | msleep(10); | 173 | msleep(10); |
174 | b = inb(io); | 174 | b = inb(io); |
175 | 175 | ||
176 | up(&dev->lock); | 176 | mutex_unlock(&dev->lock); |
177 | 177 | ||
178 | if (a != b) | 178 | if (a != b) |
179 | return (0); | 179 | return (0); |
@@ -188,7 +188,7 @@ static int zol_is_stereo (struct zol_device *dev) | |||
188 | { | 188 | { |
189 | int x1, x2; | 189 | int x1, x2; |
190 | 190 | ||
191 | down(&dev->lock); | 191 | mutex_lock(&dev->lock); |
192 | 192 | ||
193 | outb(0x00, io); | 193 | outb(0x00, io); |
194 | outb(dev->curvol, io); | 194 | outb(dev->curvol, io); |
@@ -198,7 +198,7 @@ static int zol_is_stereo (struct zol_device *dev) | |||
198 | msleep(10); | 198 | msleep(10); |
199 | x2 = inb(io); | 199 | x2 = inb(io); |
200 | 200 | ||
201 | up(&dev->lock); | 201 | mutex_unlock(&dev->lock); |
202 | 202 | ||
203 | if ((x1 == x2) && (x1 == 0xcf)) | 203 | if ((x1 == x2) && (x1 == 0xcf)) |
204 | return 1; | 204 | return 1; |
@@ -350,7 +350,7 @@ static int __init zoltrix_init(void) | |||
350 | } | 350 | } |
351 | printk(KERN_INFO "Zoltrix Radio Plus card driver.\n"); | 351 | printk(KERN_INFO "Zoltrix Radio Plus card driver.\n"); |
352 | 352 | ||
353 | init_MUTEX(&zoltrix_unit.lock); | 353 | mutex_init(&zoltrix_unit.lock); |
354 | 354 | ||
355 | /* mute card - prevents noisy bootups */ | 355 | /* mute card - prevents noisy bootups */ |
356 | 356 | ||