diff options
Diffstat (limited to 'drivers/media/radio/radio-zoltrix.c')
-rw-r--r-- | drivers/media/radio/radio-zoltrix.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 7bf1a4264891..59b86a6b4b0e 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* zoltrix radio plus driver for Linux radio support | 1 | /* zoltrix radio plus driver for Linux radio support |
2 | * (c) 1998 C. van Schaik <carl@leg.uct.ac.za> | 2 | * (c) 1998 C. van Schaik <carl@leg.uct.ac.za> |
3 | * | 3 | * |
4 | * BUGS | 4 | * BUGS |
5 | * Due to the inconsistency in reading from the signal flags | 5 | * Due to the inconsistency in reading from the signal flags |
6 | * it is difficult to get an accurate tuned signal. | 6 | * it is difficult to get an accurate tuned signal. |
7 | * | 7 | * |
@@ -14,7 +14,7 @@ | |||
14 | * | 14 | * |
15 | * 1999-05-06 - (C. van Schaik) | 15 | * 1999-05-06 - (C. van Schaik) |
16 | * - Make signal strength and stereo scans | 16 | * - Make signal strength and stereo scans |
17 | * kinder to cpu while in delay | 17 | * kinder to cpu while in delay |
18 | * 1999-01-05 - (C. van Schaik) | 18 | * 1999-01-05 - (C. van Schaik) |
19 | * - Changed tuning to 1/160Mhz accuracy | 19 | * - Changed tuning to 1/160Mhz accuracy |
20 | * - Added stereo support | 20 | * - Added stereo support |
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/io.h> /* outb, outb_p */ | 33 | #include <asm/io.h> /* outb, outb_p */ |
34 | #include <asm/uaccess.h> /* copy to/from user */ | 34 | #include <asm/uaccess.h> /* copy to/from user */ |
35 | #include <linux/videodev.h> /* kernel radio structs */ | 35 | #include <linux/videodev.h> /* kernel radio structs */ |
36 | #include <media/v4l2-common.h> | ||
36 | #include <linux/config.h> /* CONFIG_RADIO_ZOLTRIX_PORT */ | 37 | #include <linux/config.h> /* CONFIG_RADIO_ZOLTRIX_PORT */ |
37 | 38 | ||
38 | #ifndef CONFIG_RADIO_ZOLTRIX_PORT | 39 | #ifndef CONFIG_RADIO_ZOLTRIX_PORT |
@@ -105,7 +106,7 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq) | |||
105 | i = 45; | 106 | i = 45; |
106 | 107 | ||
107 | mutex_lock(&dev->lock); | 108 | mutex_lock(&dev->lock); |
108 | 109 | ||
109 | outb(0, io); | 110 | outb(0, io); |
110 | outb(0, io); | 111 | outb(0, io); |
111 | inb(io + 3); /* Zoltrix needs to be read to confirm */ | 112 | inb(io + 3); /* Zoltrix needs to be read to confirm */ |
@@ -139,8 +140,8 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq) | |||
139 | udelay(1000); | 140 | udelay(1000); |
140 | inb(io+2); | 141 | inb(io+2); |
141 | 142 | ||
142 | udelay(1000); | 143 | udelay(1000); |
143 | 144 | ||
144 | if (dev->muted) | 145 | if (dev->muted) |
145 | { | 146 | { |
146 | outb(0, io); | 147 | outb(0, io); |
@@ -148,12 +149,12 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq) | |||
148 | inb(io + 3); | 149 | inb(io + 3); |
149 | udelay(1000); | 150 | udelay(1000); |
150 | } | 151 | } |
151 | 152 | ||
152 | mutex_unlock(&dev->lock); | 153 | mutex_unlock(&dev->lock); |
153 | 154 | ||
154 | if(!dev->muted) | 155 | if(!dev->muted) |
155 | { | 156 | { |
156 | zol_setvol(dev, dev->curvol); | 157 | zol_setvol(dev, dev->curvol); |
157 | } | 158 | } |
158 | return 0; | 159 | return 0; |
159 | } | 160 | } |
@@ -174,14 +175,14 @@ static int zol_getsigstr(struct zol_device *dev) | |||
174 | b = inb(io); | 175 | b = inb(io); |
175 | 176 | ||
176 | mutex_unlock(&dev->lock); | 177 | mutex_unlock(&dev->lock); |
177 | 178 | ||
178 | if (a != b) | 179 | if (a != b) |
179 | return (0); | 180 | return (0); |
180 | 181 | ||
181 | if ((a == 0xcf) || (a == 0xdf) /* I found this out by playing */ | 182 | if ((a == 0xcf) || (a == 0xdf) /* I found this out by playing */ |
182 | || (a == 0xef)) /* with a binary scanner on the card io */ | 183 | || (a == 0xef)) /* with a binary scanner on the card io */ |
183 | return (1); | 184 | return (1); |
184 | return (0); | 185 | return (0); |
185 | } | 186 | } |
186 | 187 | ||
187 | static int zol_is_stereo (struct zol_device *dev) | 188 | static int zol_is_stereo (struct zol_device *dev) |
@@ -189,7 +190,7 @@ static int zol_is_stereo (struct zol_device *dev) | |||
189 | int x1, x2; | 190 | int x1, x2; |
190 | 191 | ||
191 | mutex_lock(&dev->lock); | 192 | mutex_lock(&dev->lock); |
192 | 193 | ||
193 | outb(0x00, io); | 194 | outb(0x00, io); |
194 | outb(dev->curvol, io); | 195 | outb(dev->curvol, io); |
195 | msleep(20); | 196 | msleep(20); |
@@ -199,7 +200,7 @@ static int zol_is_stereo (struct zol_device *dev) | |||
199 | x2 = inb(io); | 200 | x2 = inb(io); |
200 | 201 | ||
201 | mutex_unlock(&dev->lock); | 202 | mutex_unlock(&dev->lock); |
202 | 203 | ||
203 | if ((x1 == x2) && (x1 == 0xcf)) | 204 | if ((x1 == x2) && (x1 == 0xcf)) |
204 | return 1; | 205 | return 1; |
205 | return 0; | 206 | return 0; |
@@ -226,7 +227,7 @@ static int zol_do_ioctl(struct inode *inode, struct file *file, | |||
226 | case VIDIOCGTUNER: | 227 | case VIDIOCGTUNER: |
227 | { | 228 | { |
228 | struct video_tuner *v = arg; | 229 | struct video_tuner *v = arg; |
229 | if (v->tuner) | 230 | if (v->tuner) |
230 | return -EINVAL; | 231 | return -EINVAL; |
231 | strcpy(v->name, "FM"); | 232 | strcpy(v->name, "FM"); |
232 | v->rangelow = (int) (88.0 * 16000); | 233 | v->rangelow = (int) (88.0 * 16000); |
@@ -351,7 +352,7 @@ static int __init zoltrix_init(void) | |||
351 | printk(KERN_INFO "Zoltrix Radio Plus card driver.\n"); | 352 | printk(KERN_INFO "Zoltrix Radio Plus card driver.\n"); |
352 | 353 | ||
353 | mutex_init(&zoltrix_unit.lock); | 354 | mutex_init(&zoltrix_unit.lock); |
354 | 355 | ||
355 | /* mute card - prevents noisy bootups */ | 356 | /* mute card - prevents noisy bootups */ |
356 | 357 | ||
357 | /* this ensures that the volume is all the way down */ | 358 | /* this ensures that the volume is all the way down */ |