aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-zoltrix.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:09:31 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:09:31 -0400
commit25581ad107be24b89d805da51a03d616f8f3d1be (patch)
tree36e2bd32667b5dd5a39e1939c1c5162f18967715 /drivers/media/radio/radio-zoltrix.c
parent72cf2709bf8e0410800f118c4298bfbf8715b303 (diff)
parent7477ddaa4d2d69bbcd49e12990af158dbb03f2f2 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (244 commits) V4L/DVB (4210b): git-dvb: tea575x-tuner build fix V4L/DVB (4210a): git-dvb versus matroxfb V4L/DVB (4209): Added some BTTV PCI IDs for newer boards Fixes some sync issues between V4L/DVB development and GIT V4L/DVB (4206): Cx88-blackbird: always set encoder height based on tvnorm->id V4L/DVB (4205): Merge tda9887 module into tuner. V4L/DVB (4203): Explicitly set the enum values. V4L/DVB (4202): allow selecting CX2341x port mode V4L/DVB (4200): Disable bitrate_mode when encoding mpeg-1. V4L/DVB (4199): Add cx2341x-specific control array to cx2341x.c V4L/DVB (4198): Avoid newer usages of obsoleted experimental MPEGCOMP API V4L/DVB (4197): Port new MPEG API to saa7134-empress with saa6752hs V4L/DVB (4196): Port cx88-blackbird to the new MPEG API. V4L/DVB (4193): Update cx2341x fw encoding API doc. V4L/DVB (4192): Use control helpers for saa7115, cx25840, msp3400. V4L/DVB (4191): Add CX2341X MPEG encoder module. V4L/DVB (4190): Add helper functions for control processing to v4l2-common. V4L/DVB (4189): Add videodev support for VIDIOC_S/G/TRY_EXT_CTRLS. V4L/DVB (4188): Add new MPEG control/ioctl definitions to videodev2.h V4L/DVB (4186): Add support for the DNTV Live! mini DVB-T card. ...
Diffstat (limited to 'drivers/media/radio/radio-zoltrix.c')
-rw-r--r--drivers/media/radio/radio-zoltrix.c31
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
187static int zol_is_stereo (struct zol_device *dev) 188static 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 */