aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-rtrack2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/radio/radio-rtrack2.c')
-rw-r--r--drivers/media/radio/radio-rtrack2.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c
index 28a47c9e7a81..3821d25ed411 100644
--- a/drivers/media/radio/radio-rtrack2.c
+++ b/drivers/media/radio/radio-rtrack2.c
@@ -1,5 +1,5 @@
1/* RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff 1/* RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff
2 * 2 *
3 * Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood 3 * Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood
4 * Converted to new API by Alan Cox <Alan.Cox@linux.org> 4 * Converted to new API by Alan Cox <Alan.Cox@linux.org>
5 * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> 5 * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
@@ -22,7 +22,7 @@
22#define CONFIG_RADIO_RTRACK2_PORT -1 22#define CONFIG_RADIO_RTRACK2_PORT -1
23#endif 23#endif
24 24
25static int io = CONFIG_RADIO_RTRACK2_PORT; 25static int io = CONFIG_RADIO_RTRACK2_PORT;
26static int radio_nr = -1; 26static int radio_nr = -1;
27static spinlock_t lock; 27static spinlock_t lock;
28 28
@@ -38,7 +38,7 @@ struct rt_device
38 38
39static void rt_mute(struct rt_device *dev) 39static void rt_mute(struct rt_device *dev)
40{ 40{
41 if(dev->muted) 41 if(dev->muted)
42 return; 42 return;
43 spin_lock(&lock); 43 spin_lock(&lock);
44 outb(1, io); 44 outb(1, io);
@@ -58,14 +58,14 @@ static void rt_unmute(struct rt_device *dev)
58 58
59static void zero(void) 59static void zero(void)
60{ 60{
61 outb_p(1, io); 61 outb_p(1, io);
62 outb_p(3, io); 62 outb_p(3, io);
63 outb_p(1, io); 63 outb_p(1, io);
64} 64}
65 65
66static void one(void) 66static void one(void)
67{ 67{
68 outb_p(5, io); 68 outb_p(5, io);
69 outb_p(7, io); 69 outb_p(7, io);
70 outb_p(5, io); 70 outb_p(5, io);
71} 71}
@@ -75,7 +75,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
75 int i; 75 int i;
76 76
77 freq = freq / 200 + 856; 77 freq = freq / 200 + 856;
78 78
79 spin_lock(&lock); 79 spin_lock(&lock);
80 80
81 outb_p(0xc8, io); 81 outb_p(0xc8, io);
@@ -94,7 +94,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
94 outb_p(0xc8, io); 94 outb_p(0xc8, io);
95 if (!dev->muted) 95 if (!dev->muted)
96 outb_p(0, io); 96 outb_p(0, io);
97 97
98 spin_unlock(&lock); 98 spin_unlock(&lock);
99 return 0; 99 return 0;
100} 100}
@@ -127,7 +127,7 @@ static int rt_do_ioctl(struct inode *inode, struct file *file,
127 case VIDIOCGTUNER: 127 case VIDIOCGTUNER:
128 { 128 {
129 struct video_tuner *v = arg; 129 struct video_tuner *v = arg;
130 if(v->tuner) /* Only 1 tuner */ 130 if(v->tuner) /* Only 1 tuner */
131 return -EINVAL; 131 return -EINVAL;
132 v->rangelow=88*16000; 132 v->rangelow=88*16000;
133 v->rangehigh=108*16000; 133 v->rangehigh=108*16000;
@@ -159,25 +159,25 @@ static int rt_do_ioctl(struct inode *inode, struct file *file,
159 return 0; 159 return 0;
160 } 160 }
161 case VIDIOCGAUDIO: 161 case VIDIOCGAUDIO:
162 { 162 {
163 struct video_audio *v = arg; 163 struct video_audio *v = arg;
164 memset(v,0, sizeof(*v)); 164 memset(v,0, sizeof(*v));
165 v->flags|=VIDEO_AUDIO_MUTABLE; 165 v->flags|=VIDEO_AUDIO_MUTABLE;
166 v->volume=1; 166 v->volume=1;
167 v->step=65535; 167 v->step=65535;
168 strcpy(v->name, "Radio"); 168 strcpy(v->name, "Radio");
169 return 0; 169 return 0;
170 } 170 }
171 case VIDIOCSAUDIO: 171 case VIDIOCSAUDIO:
172 { 172 {
173 struct video_audio *v = arg; 173 struct video_audio *v = arg;
174 if(v->audio) 174 if(v->audio)
175 return -EINVAL; 175 return -EINVAL;
176 176
177 if(v->flags&VIDEO_AUDIO_MUTE) 177 if(v->flags&VIDEO_AUDIO_MUTE)
178 rt_mute(rt); 178 rt_mute(rt);
179 else 179 else
180 rt_unmute(rt); 180 rt_unmute(rt);
181 181
182 return 0; 182 return 0;
183 } 183 }
@@ -219,7 +219,7 @@ static int __init rtrack2_init(void)
219 printk(KERN_ERR "You must set an I/O address with io=0x20c or io=0x30c\n"); 219 printk(KERN_ERR "You must set an I/O address with io=0x20c or io=0x30c\n");
220 return -EINVAL; 220 return -EINVAL;
221 } 221 }
222 if (!request_region(io, 4, "rtrack2")) 222 if (!request_region(io, 4, "rtrack2"))
223 { 223 {
224 printk(KERN_ERR "rtrack2: port 0x%x already in use\n", io); 224 printk(KERN_ERR "rtrack2: port 0x%x already in use\n", io);
225 return -EBUSY; 225 return -EBUSY;
@@ -227,16 +227,16 @@ static int __init rtrack2_init(void)
227 227
228 rtrack2_radio.priv=&rtrack2_unit; 228 rtrack2_radio.priv=&rtrack2_unit;
229 229
230 spin_lock_init(&lock); 230 spin_lock_init(&lock);
231 if(video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr)==-1) 231 if(video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr)==-1)
232 { 232 {
233 release_region(io, 4); 233 release_region(io, 4);
234 return -EINVAL; 234 return -EINVAL;
235 } 235 }
236 236
237 printk(KERN_INFO "AIMSlab Radiotrack II card driver.\n"); 237 printk(KERN_INFO "AIMSlab Radiotrack II card driver.\n");
238 238
239 /* mute card - prevents noisy bootups */ 239 /* mute card - prevents noisy bootups */
240 outb(1, io); 240 outb(1, io);
241 rtrack2_unit.muted = 1; 241 rtrack2_unit.muted = 1;
242 242