Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* Terratec ActiveRadio ISA Standalone card driver for Linux radio support |
| 2 | * (c) 1999 R. Offermanns (rolf@offermanns.de) |
| 3 | * based on the aimslab radio driver from M. Kirkwood |
| 4 | * many thanks to Michael Becker and Friedhelm Birth (from TerraTec) |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 5 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * |
| 7 | * History: |
| 8 | * 1999-05-21 First preview release |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 9 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * Notes on the hardware: |
| 11 | * There are two "main" chips on the card: |
| 12 | * - Philips OM5610 (http://www-us.semiconductors.philips.com/acrobat/datasheets/OM5610_2.pdf) |
| 13 | * - Philips SAA6588 (http://www-us.semiconductors.philips.com/acrobat/datasheets/SAA6588_1.pdf) |
| 14 | * (you can get the datasheet at the above links) |
| 15 | * |
| 16 | * Frequency control is done digitally -- ie out(port,encodefreq(95.8)); |
| 17 | * Volume Control is done digitally |
| 18 | * |
| 19 | * there is a I2C controlled RDS decoder (SAA6588) onboard, which i would like to support someday |
| 20 | * (as soon i have understand how to get started :) |
| 21 | * If you can help me out with that, please contact me!! |
| 22 | * |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 23 | * |
Mauro Carvalho Chehab | 55ac7b6 | 2006-08-08 09:10:03 -0300 | [diff] [blame] | 24 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | #include <linux/module.h> /* Modules */ |
| 28 | #include <linux/init.h> /* Initdata */ |
Peter Osterlund | fb911ee | 2005-09-13 01:25:15 -0700 | [diff] [blame] | 29 | #include <linux/ioport.h> /* request_region */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #include <linux/delay.h> /* udelay */ |
| 31 | #include <asm/io.h> /* outb, outb_p */ |
| 32 | #include <asm/uaccess.h> /* copy to/from user */ |
Mauro Carvalho Chehab | 55ac7b6 | 2006-08-08 09:10:03 -0300 | [diff] [blame] | 33 | #include <linux/videodev2.h> /* kernel radio structs */ |
Mauro Carvalho Chehab | 5e87efa | 2006-06-05 10:26:32 -0300 | [diff] [blame] | 34 | #include <media/v4l2-common.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #include <linux/spinlock.h> |
| 36 | |
Mauro Carvalho Chehab | 55ac7b6 | 2006-08-08 09:10:03 -0300 | [diff] [blame] | 37 | #include <linux/version.h> /* for KERNEL_VERSION MACRO */ |
| 38 | #define RADIO_VERSION KERNEL_VERSION(0,0,2) |
| 39 | |
| 40 | static struct v4l2_queryctrl radio_qctrl[] = { |
| 41 | { |
| 42 | .id = V4L2_CID_AUDIO_MUTE, |
| 43 | .name = "Mute", |
| 44 | .minimum = 0, |
| 45 | .maximum = 1, |
| 46 | .default_value = 1, |
| 47 | .type = V4L2_CTRL_TYPE_BOOLEAN, |
| 48 | },{ |
| 49 | .id = V4L2_CID_AUDIO_VOLUME, |
| 50 | .name = "Volume", |
| 51 | .minimum = 0, |
| 52 | .maximum = 0xff, |
| 53 | .step = 1, |
| 54 | .default_value = 0xff, |
| 55 | .type = V4L2_CTRL_TYPE_INTEGER, |
| 56 | } |
| 57 | }; |
| 58 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | #ifndef CONFIG_RADIO_TERRATEC_PORT |
| 60 | #define CONFIG_RADIO_TERRATEC_PORT 0x590 |
| 61 | #endif |
| 62 | |
| 63 | /**************** this ones are for the terratec *******************/ |
| 64 | #define BASEPORT 0x590 |
| 65 | #define VOLPORT 0x591 |
| 66 | #define WRT_DIS 0x00 |
| 67 | #define CLK_OFF 0x00 |
| 68 | #define IIC_DATA 0x01 |
| 69 | #define IIC_CLK 0x02 |
| 70 | #define DATA 0x04 |
| 71 | #define CLK_ON 0x08 |
| 72 | #define WRT_EN 0x10 |
| 73 | /*******************************************************************/ |
| 74 | |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 75 | static int io = CONFIG_RADIO_TERRATEC_PORT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | static int radio_nr = -1; |
| 77 | static spinlock_t lock; |
| 78 | |
| 79 | struct tt_device |
| 80 | { |
| 81 | int port; |
| 82 | int curvol; |
| 83 | unsigned long curfreq; |
| 84 | int muted; |
| 85 | }; |
| 86 | |
| 87 | |
| 88 | /* local things */ |
| 89 | |
| 90 | static void cardWriteVol(int volume) |
| 91 | { |
| 92 | int i; |
| 93 | volume = volume+(volume * 32); // change both channels |
| 94 | spin_lock(&lock); |
| 95 | for (i=0;i<8;i++) |
| 96 | { |
| 97 | if (volume & (0x80>>i)) |
| 98 | outb(0x80, VOLPORT); |
| 99 | else outb(0x00, VOLPORT); |
| 100 | } |
| 101 | spin_unlock(&lock); |
| 102 | } |
| 103 | |
| 104 | |
| 105 | |
| 106 | static void tt_mute(struct tt_device *dev) |
| 107 | { |
| 108 | dev->muted = 1; |
| 109 | cardWriteVol(0); |
| 110 | } |
| 111 | |
| 112 | static int tt_setvol(struct tt_device *dev, int vol) |
| 113 | { |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 114 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | // printk(KERN_ERR "setvol called, vol = %d\n", vol); |
| 116 | |
| 117 | if(vol == dev->curvol) { /* requested volume = current */ |
| 118 | if (dev->muted) { /* user is unmuting the card */ |
| 119 | dev->muted = 0; |
| 120 | cardWriteVol(vol); /* enable card */ |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 121 | } |
| 122 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | return 0; |
| 124 | } |
| 125 | |
| 126 | if(vol == 0) { /* volume = 0 means mute the card */ |
| 127 | cardWriteVol(0); /* "turn off card" by setting vol to 0 */ |
| 128 | dev->curvol = vol; /* track the volume state! */ |
| 129 | return 0; |
| 130 | } |
| 131 | |
| 132 | dev->muted = 0; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 133 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | cardWriteVol(vol); |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 135 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | dev->curvol = vol; |
| 137 | |
| 138 | return 0; |
| 139 | |
| 140 | } |
| 141 | |
| 142 | |
| 143 | /* this is the worst part in this driver */ |
| 144 | /* many more or less strange things are going on here, but hey, it works :) */ |
| 145 | |
| 146 | static int tt_setfreq(struct tt_device *dev, unsigned long freq1) |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 147 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | int freq; |
| 149 | int i; |
| 150 | int p; |
| 151 | int temp; |
| 152 | long rest; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 153 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | unsigned char buffer[25]; /* we have to bit shift 25 registers */ |
| 155 | freq = freq1/160; /* convert the freq. to a nice to handle value */ |
| 156 | for(i=24;i>-1;i--) |
| 157 | buffer[i]=0; |
| 158 | |
| 159 | rest = freq*10+10700; /* i once had understood what is going on here */ |
| 160 | /* maybe some wise guy (friedhelm?) can comment this stuff */ |
| 161 | i=13; |
| 162 | p=10; |
| 163 | temp=102400; |
| 164 | while (rest!=0) |
| 165 | { |
| 166 | if (rest%temp == rest) |
| 167 | buffer[i] = 0; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 168 | else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | { |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 170 | buffer[i] = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | rest = rest-temp; |
| 172 | } |
| 173 | i--; |
| 174 | p--; |
| 175 | temp = temp/2; |
| 176 | } |
| 177 | |
| 178 | spin_lock(&lock); |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 179 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | for (i=24;i>-1;i--) /* bit shift the values to the radiocard */ |
| 181 | { |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 182 | if (buffer[i]==1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | { |
| 184 | outb(WRT_EN|DATA, BASEPORT); |
| 185 | outb(WRT_EN|DATA|CLK_ON , BASEPORT); |
| 186 | outb(WRT_EN|DATA, BASEPORT); |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | outb(WRT_EN|0x00, BASEPORT); |
| 191 | outb(WRT_EN|0x00|CLK_ON , BASEPORT); |
| 192 | } |
| 193 | } |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 194 | outb(0x00, BASEPORT); |
| 195 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | spin_unlock(&lock); |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 197 | |
| 198 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | static int tt_getsigstr(struct tt_device *dev) /* TODO */ |
| 202 | { |
| 203 | if (inb(io) & 2) /* bit set = no signal present */ |
| 204 | return 0; |
| 205 | return 1; /* signal present */ |
| 206 | } |
| 207 | |
Douglas Landgraf | 1de6923 | 2007-04-22 23:15:47 -0300 | [diff] [blame^] | 208 | static int vidioc_querycap(struct file *file, void *priv, |
| 209 | struct v4l2_capability *v) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | { |
Douglas Landgraf | 1de6923 | 2007-04-22 23:15:47 -0300 | [diff] [blame^] | 211 | strlcpy(v->driver, "radio-terratec", sizeof(v->driver)); |
| 212 | strlcpy(v->card, "ActiveRadio", sizeof(v->card)); |
| 213 | sprintf(v->bus_info, "ISA"); |
| 214 | v->version = RADIO_VERSION; |
| 215 | v->capabilities = V4L2_CAP_TUNER; |
| 216 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | } |
| 218 | |
Douglas Landgraf | 1de6923 | 2007-04-22 23:15:47 -0300 | [diff] [blame^] | 219 | static int vidioc_g_tuner(struct file *file, void *priv, |
| 220 | struct v4l2_tuner *v) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | { |
Douglas Landgraf | 1de6923 | 2007-04-22 23:15:47 -0300 | [diff] [blame^] | 222 | struct video_device *dev = video_devdata(file); |
| 223 | struct tt_device *tt = dev->priv; |
| 224 | |
| 225 | if (v->index > 0) |
| 226 | return -EINVAL; |
| 227 | |
| 228 | strcpy(v->name, "FM"); |
| 229 | v->type = V4L2_TUNER_RADIO; |
| 230 | v->rangelow = (87*16000); |
| 231 | v->rangehigh = (108*16000); |
| 232 | v->rxsubchans = V4L2_TUNER_SUB_MONO; |
| 233 | v->capability = V4L2_TUNER_CAP_LOW; |
| 234 | v->audmode = V4L2_TUNER_MODE_MONO; |
| 235 | v->signal = 0xFFFF*tt_getsigstr(tt); |
| 236 | return 0; |
| 237 | } |
| 238 | |
| 239 | static int vidioc_s_tuner(struct file *file, void *priv, |
| 240 | struct v4l2_tuner *v) |
| 241 | { |
| 242 | if (v->index > 0) |
| 243 | return -EINVAL; |
| 244 | return 0; |
| 245 | } |
| 246 | |
| 247 | static int vidioc_s_frequency(struct file *file, void *priv, |
| 248 | struct v4l2_frequency *f) |
| 249 | { |
| 250 | struct video_device *dev = video_devdata(file); |
| 251 | struct tt_device *tt = dev->priv; |
| 252 | |
| 253 | tt->curfreq = f->frequency; |
| 254 | tt_setfreq(tt, tt->curfreq); |
| 255 | return 0; |
| 256 | } |
| 257 | |
| 258 | static int vidioc_g_frequency(struct file *file, void *priv, |
| 259 | struct v4l2_frequency *f) |
| 260 | { |
| 261 | struct video_device *dev = video_devdata(file); |
| 262 | struct tt_device *tt = dev->priv; |
| 263 | |
| 264 | f->type = V4L2_TUNER_RADIO; |
| 265 | f->frequency = tt->curfreq; |
| 266 | return 0; |
| 267 | } |
| 268 | |
| 269 | static int vidioc_queryctrl(struct file *file, void *priv, |
| 270 | struct v4l2_queryctrl *qc) |
| 271 | { |
| 272 | int i; |
| 273 | |
| 274 | for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { |
| 275 | if (qc->id && qc->id == radio_qctrl[i].id) { |
| 276 | memcpy(qc, &(radio_qctrl[i]), |
| 277 | sizeof(*qc)); |
| 278 | return 0; |
| 279 | } |
| 280 | } |
| 281 | return -EINVAL; |
| 282 | } |
| 283 | |
| 284 | static int vidioc_g_ctrl(struct file *file, void *priv, |
| 285 | struct v4l2_control *ctrl) |
| 286 | { |
| 287 | struct video_device *dev = video_devdata(file); |
| 288 | struct tt_device *tt = dev->priv; |
| 289 | |
| 290 | switch (ctrl->id) { |
| 291 | case V4L2_CID_AUDIO_MUTE: |
| 292 | if (tt->muted) |
| 293 | ctrl->value = 1; |
| 294 | else |
| 295 | ctrl->value = 0; |
| 296 | return 0; |
| 297 | case V4L2_CID_AUDIO_VOLUME: |
| 298 | ctrl->value = tt->curvol * 6554; |
| 299 | return 0; |
| 300 | } |
| 301 | return -EINVAL; |
| 302 | } |
| 303 | |
| 304 | static int vidioc_s_ctrl(struct file *file, void *priv, |
| 305 | struct v4l2_control *ctrl) |
| 306 | { |
| 307 | struct video_device *dev = video_devdata(file); |
| 308 | struct tt_device *tt = dev->priv; |
| 309 | |
| 310 | switch (ctrl->id) { |
| 311 | case V4L2_CID_AUDIO_MUTE: |
| 312 | if (ctrl->value) |
| 313 | tt_mute(tt); |
| 314 | else |
| 315 | tt_setvol(tt,tt->curvol); |
| 316 | return 0; |
| 317 | case V4L2_CID_AUDIO_VOLUME: |
| 318 | tt_setvol(tt,ctrl->value); |
| 319 | return 0; |
| 320 | } |
| 321 | return -EINVAL; |
| 322 | } |
| 323 | |
| 324 | static int vidioc_g_audio(struct file *file, void *priv, |
| 325 | struct v4l2_audio *a) |
| 326 | { |
| 327 | if (a->index > 1) |
| 328 | return -EINVAL; |
| 329 | |
| 330 | strcpy(a->name, "Radio"); |
| 331 | a->capability = V4L2_AUDCAP_STEREO; |
| 332 | return 0; |
| 333 | } |
| 334 | |
| 335 | static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i) |
| 336 | { |
| 337 | *i = 0; |
| 338 | return 0; |
| 339 | } |
| 340 | |
| 341 | static int vidioc_s_input(struct file *filp, void *priv, unsigned int i) |
| 342 | { |
| 343 | if (i != 0) |
| 344 | return -EINVAL; |
| 345 | return 0; |
| 346 | } |
| 347 | |
| 348 | static int vidioc_s_audio(struct file *file, void *priv, |
| 349 | struct v4l2_audio *a) |
| 350 | { |
| 351 | if (a->index != 0) |
| 352 | return -EINVAL; |
| 353 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | static struct tt_device terratec_unit; |
| 357 | |
Arjan van de Ven | fa027c2 | 2007-02-12 00:55:33 -0800 | [diff] [blame] | 358 | static const struct file_operations terratec_fops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | .owner = THIS_MODULE, |
| 360 | .open = video_exclusive_open, |
| 361 | .release = video_exclusive_release, |
Douglas Landgraf | 1de6923 | 2007-04-22 23:15:47 -0300 | [diff] [blame^] | 362 | .ioctl = video_ioctl2, |
Arnd Bergmann | 0d0fbf8 | 2006-01-09 15:24:57 -0200 | [diff] [blame] | 363 | .compat_ioctl = v4l_compat_ioctl32, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | .llseek = no_llseek, |
| 365 | }; |
| 366 | |
| 367 | static struct video_device terratec_radio= |
| 368 | { |
| 369 | .owner = THIS_MODULE, |
| 370 | .name = "TerraTec ActiveRadio", |
| 371 | .type = VID_TYPE_TUNER, |
Mauro Carvalho Chehab | 55ac7b6 | 2006-08-08 09:10:03 -0300 | [diff] [blame] | 372 | .hardware = 0, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | .fops = &terratec_fops, |
Douglas Landgraf | 1de6923 | 2007-04-22 23:15:47 -0300 | [diff] [blame^] | 374 | .vidioc_querycap = vidioc_querycap, |
| 375 | .vidioc_g_tuner = vidioc_g_tuner, |
| 376 | .vidioc_s_tuner = vidioc_s_tuner, |
| 377 | .vidioc_g_frequency = vidioc_g_frequency, |
| 378 | .vidioc_s_frequency = vidioc_s_frequency, |
| 379 | .vidioc_queryctrl = vidioc_queryctrl, |
| 380 | .vidioc_g_ctrl = vidioc_g_ctrl, |
| 381 | .vidioc_s_ctrl = vidioc_s_ctrl, |
| 382 | .vidioc_g_audio = vidioc_g_audio, |
| 383 | .vidioc_s_audio = vidioc_s_audio, |
| 384 | .vidioc_g_input = vidioc_g_input, |
| 385 | .vidioc_s_input = vidioc_s_input, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | }; |
| 387 | |
| 388 | static int __init terratec_init(void) |
| 389 | { |
| 390 | if(io==-1) |
| 391 | { |
| 392 | printk(KERN_ERR "You must set an I/O address with io=0x???\n"); |
| 393 | return -EINVAL; |
| 394 | } |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 395 | if (!request_region(io, 2, "terratec")) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 396 | { |
| 397 | printk(KERN_ERR "TerraTec: port 0x%x already in use\n", io); |
| 398 | return -EBUSY; |
| 399 | } |
| 400 | |
| 401 | terratec_radio.priv=&terratec_unit; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 402 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 403 | spin_lock_init(&lock); |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 404 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | if(video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr)==-1) |
| 406 | { |
| 407 | release_region(io,2); |
| 408 | return -EINVAL; |
| 409 | } |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 410 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver.\n"); |
| 412 | |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 413 | /* mute card - prevents noisy bootups */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | |
| 415 | /* this ensures that the volume is all the way down */ |
| 416 | cardWriteVol(0); |
| 417 | terratec_unit.curvol = 0; |
| 418 | |
| 419 | return 0; |
| 420 | } |
| 421 | |
| 422 | MODULE_AUTHOR("R.OFFERMANNS & others"); |
| 423 | MODULE_DESCRIPTION("A driver for the TerraTec ActiveRadio Standalone radio card."); |
| 424 | MODULE_LICENSE("GPL"); |
| 425 | module_param(io, int, 0); |
| 426 | MODULE_PARM_DESC(io, "I/O address of the TerraTec ActiveRadio card (0x590 or 0x591)"); |
| 427 | module_param(radio_nr, int, 0); |
| 428 | |
| 429 | static void __exit terratec_cleanup_module(void) |
| 430 | { |
| 431 | video_unregister_device(&terratec_radio); |
| 432 | release_region(io,2); |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 433 | printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver unloaded.\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | } |
| 435 | |
| 436 | module_init(terratec_init); |
| 437 | module_exit(terratec_cleanup_module); |
| 438 | |