blob: 35f6f403f65d4d2c8e7bbd9408e18034899d124e [file] [log] [blame]
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -03001/* radio-aztech.c - Aztech radio card driver for Linux 2.2
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -03003 * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -03004 * Adapted to support the Video for Linux API by
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by:
6 *
7 * Quay Ly
8 * Donald Song
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -03009 * Jason Lewis (jlewis@twilight.vtc.vsc.edu)
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 * Scott McGrath (smcgrath@twilight.vtc.vsc.edu)
11 * William McGrath (wmcgrath@twilight.vtc.vsc.edu)
12 *
13 * The basis for this code may be found at http://bigbang.vtc.vsc.edu/fmradio/
14 * along with more information on the card itself.
15 *
16 * History:
17 * 1999-02-24 Russell Kroll <rkroll@exploits.org>
18 * Fine tuning/VIDEO_TUNER_LOW
19 * Range expanded to 87-108 MHz (from 87.9-107.8)
20 *
21 * Notable changes from the original source:
22 * - includes stripped down to the essentials
23 * - for loops used as delays replaced with udelay()
24 * - #defines removed, changed to static values
25 * - tuning structure changed - no more character arrays, other changes
26*/
27
28#include <linux/module.h> /* Modules */
29#include <linux/init.h> /* Initdata */
Peter Osterlundfb911ee2005-09-13 01:25:15 -070030#include <linux/ioport.h> /* request_region */
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include <linux/delay.h> /* udelay */
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -030032#include <linux/videodev2.h> /* kernel radio structs */
Hans Verkuile697e122009-03-06 13:48:18 -030033#include <linux/version.h> /* for KERNEL_VERSION MACRO */
34#include <linux/io.h> /* outb, outb_p */
35#include <linux/uaccess.h> /* copy to/from user */
36#include <media/v4l2-device.h>
Hans Verkuil35ea11f2008-07-20 08:12:02 -030037#include <media/v4l2-ioctl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Hans Verkuile697e122009-03-06 13:48:18 -030039MODULE_AUTHOR("Russell Kroll, Quay Lu, Donald Song, Jason Lewis, Scott McGrath, William McGrath");
40MODULE_DESCRIPTION("A driver for the Aztech radio card.");
41MODULE_LICENSE("GPL");
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -030042
Linus Torvalds1da177e2005-04-16 15:20:36 -070043/* acceptable ports: 0x350 (JP3 shorted), 0x358 (JP3 open) */
44
45#ifndef CONFIG_RADIO_AZTECH_PORT
46#define CONFIG_RADIO_AZTECH_PORT -1
47#endif
48
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -030049static int io = CONFIG_RADIO_AZTECH_PORT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050static int radio_nr = -1;
51static int radio_wait_time = 1000;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Hans Verkuile697e122009-03-06 13:48:18 -030053module_param(io, int, 0);
54module_param(radio_nr, int, 0);
55MODULE_PARM_DESC(io, "I/O address of the Aztech card (0x350 or 0x358)");
56
57#define RADIO_VERSION KERNEL_VERSION(0, 0, 2)
58
59struct aztech
Linus Torvalds1da177e2005-04-16 15:20:36 -070060{
Hans Verkuile697e122009-03-06 13:48:18 -030061 struct v4l2_device v4l2_dev;
62 struct video_device vdev;
63 int io;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 int curvol;
65 unsigned long curfreq;
66 int stereo;
Hans Verkuile697e122009-03-06 13:48:18 -030067 struct mutex lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -070068};
69
Hans Verkuile697e122009-03-06 13:48:18 -030070static struct aztech aztech_card;
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072static int volconvert(int level)
73{
Hans Verkuile697e122009-03-06 13:48:18 -030074 level >>= 14; /* Map 16bits down to 2 bit */
75 level &= 3;
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -030076
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 /* convert to card-friendly values */
Hans Verkuile697e122009-03-06 13:48:18 -030078 switch (level) {
79 case 0:
80 return 0;
81 case 1:
82 return 1;
83 case 2:
84 return 4;
85 case 3:
86 return 5;
Linus Torvalds1da177e2005-04-16 15:20:36 -070087 }
88 return 0; /* Quieten gcc */
89}
90
Hans Verkuile697e122009-03-06 13:48:18 -030091static void send_0_byte(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -070092{
93 udelay(radio_wait_time);
Hans Verkuile697e122009-03-06 13:48:18 -030094 outb_p(2 + volconvert(az->curvol), az->io);
95 outb_p(64 + 2 + volconvert(az->curvol), az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096}
97
Hans Verkuile697e122009-03-06 13:48:18 -030098static void send_1_byte(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -070099{
100 udelay (radio_wait_time);
Hans Verkuile697e122009-03-06 13:48:18 -0300101 outb_p(128 + 2 + volconvert(az->curvol), az->io);
102 outb_p(128 + 64 + 2 + volconvert(az->curvol), az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103}
104
Hans Verkuile697e122009-03-06 13:48:18 -0300105static int az_setvol(struct aztech *az, int vol)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106{
Hans Verkuile697e122009-03-06 13:48:18 -0300107 mutex_lock(&az->lock);
108 outb(volconvert(vol), az->io);
109 mutex_unlock(&az->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 return 0;
111}
112
113/* thanks to Michael Dwyer for giving me a dose of clues in
114 * the signal strength department..
115 *
116 * This card has a stereo bit - bit 0 set = mono, not set = stereo
117 * It also has a "signal" bit - bit 1 set = bad signal, not set = good
118 *
119 */
120
Hans Verkuile697e122009-03-06 13:48:18 -0300121static int az_getsigstr(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122{
Hans Verkuile697e122009-03-06 13:48:18 -0300123 int sig = 1;
124
125 mutex_lock(&az->lock);
126 if (inb(az->io) & 2) /* bit set = no signal present */
127 sig = 0;
128 mutex_unlock(&az->lock);
129 return sig;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130}
131
Hans Verkuile697e122009-03-06 13:48:18 -0300132static int az_getstereo(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133{
Hans Verkuile697e122009-03-06 13:48:18 -0300134 int stereo = 1;
135
136 mutex_lock(&az->lock);
137 if (inb(az->io) & 1) /* bit set = mono */
138 stereo = 0;
139 mutex_unlock(&az->lock);
140 return stereo;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141}
142
Hans Verkuile697e122009-03-06 13:48:18 -0300143static int az_setfreq(struct aztech *az, unsigned long frequency)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144{
145 int i;
146
Hans Verkuile697e122009-03-06 13:48:18 -0300147 mutex_lock(&az->lock);
148
149 az->curfreq = frequency;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150 frequency += 171200; /* Add 10.7 MHz IF */
151 frequency /= 800; /* Convert to 50 kHz units */
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300152
Hans Verkuile697e122009-03-06 13:48:18 -0300153 send_0_byte(az); /* 0: LSB of frequency */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154
155 for (i = 0; i < 13; i++) /* : frequency bits (1-13) */
156 if (frequency & (1 << i))
Hans Verkuile697e122009-03-06 13:48:18 -0300157 send_1_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158 else
Hans Verkuile697e122009-03-06 13:48:18 -0300159 send_0_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Hans Verkuile697e122009-03-06 13:48:18 -0300161 send_0_byte(az); /* 14: test bit - always 0 */
162 send_0_byte(az); /* 15: test bit - always 0 */
163 send_0_byte(az); /* 16: band data 0 - always 0 */
164 if (az->stereo) /* 17: stereo (1 to enable) */
165 send_1_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 else
Hans Verkuile697e122009-03-06 13:48:18 -0300167 send_0_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
Hans Verkuile697e122009-03-06 13:48:18 -0300169 send_1_byte(az); /* 18: band data 1 - unknown */
170 send_0_byte(az); /* 19: time base - always 0 */
171 send_0_byte(az); /* 20: spacing (0 = 25 kHz) */
172 send_1_byte(az); /* 21: spacing (1 = 25 kHz) */
173 send_0_byte(az); /* 22: spacing (0 = 25 kHz) */
174 send_1_byte(az); /* 23: AM/FM (FM = 1, always) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175
176 /* latch frequency */
177
Hans Verkuile697e122009-03-06 13:48:18 -0300178 udelay(radio_wait_time);
179 outb_p(128 + 64 + volconvert(az->curvol), az->io);
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300180
Hans Verkuile697e122009-03-06 13:48:18 -0300181 mutex_unlock(&az->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183 return 0;
184}
185
Hans Verkuile697e122009-03-06 13:48:18 -0300186static int vidioc_querycap(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300187 struct v4l2_capability *v)
188{
Hans Verkuile697e122009-03-06 13:48:18 -0300189 strlcpy(v->driver, "radio-aztech", sizeof(v->driver));
190 strlcpy(v->card, "Aztech Radio", sizeof(v->card));
191 strlcpy(v->bus_info, "ISA", sizeof(v->bus_info));
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300192 v->version = RADIO_VERSION;
Hans Verkuile697e122009-03-06 13:48:18 -0300193 v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300194 return 0;
195}
196
Hans Verkuile697e122009-03-06 13:48:18 -0300197static int vidioc_g_tuner(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300198 struct v4l2_tuner *v)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199{
Hans Verkuile697e122009-03-06 13:48:18 -0300200 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300201
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300202 if (v->index > 0)
203 return -EINVAL;
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -0300204
Hans Verkuile697e122009-03-06 13:48:18 -0300205 strlcpy(v->name, "FM", sizeof(v->name));
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300206 v->type = V4L2_TUNER_RADIO;
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -0300207
Hans Verkuile697e122009-03-06 13:48:18 -0300208 v->rangelow = 87 * 16000;
209 v->rangehigh = 108 * 16000;
210 v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
211 v->capability = V4L2_TUNER_CAP_LOW;
212 if (az_getstereo(az))
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300213 v->audmode = V4L2_TUNER_MODE_STEREO;
214 else
215 v->audmode = V4L2_TUNER_MODE_MONO;
Hans Verkuile697e122009-03-06 13:48:18 -0300216 v->signal = 0xFFFF * az_getsigstr(az);
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -0300217
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300218 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219}
220
Hans Verkuile697e122009-03-06 13:48:18 -0300221static int vidioc_s_tuner(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300222 struct v4l2_tuner *v)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223{
Hans Verkuile697e122009-03-06 13:48:18 -0300224 return v->index ? -EINVAL : 0;
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300225}
226
Mauro Carvalho Chehaba0c05ab2007-01-25 16:48:13 -0300227static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
228{
229 *i = 0;
230 return 0;
231}
232
233static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
234{
Hans Verkuile697e122009-03-06 13:48:18 -0300235 return i ? -EINVAL : 0;
Mauro Carvalho Chehaba0c05ab2007-01-25 16:48:13 -0300236}
237
Hans Verkuile697e122009-03-06 13:48:18 -0300238static int vidioc_g_audio(struct file *file, void *priv,
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300239 struct v4l2_audio *a)
240{
Hans Verkuile697e122009-03-06 13:48:18 -0300241 a->index = 0;
242 strlcpy(a->name, "Radio", sizeof(a->name));
243 a->capability = V4L2_AUDCAP_STEREO;
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300244 return 0;
245}
246
Hans Verkuile697e122009-03-06 13:48:18 -0300247static int vidioc_s_audio(struct file *file, void *priv,
248 struct v4l2_audio *a)
249{
250 return a->index ? -EINVAL : 0;
251}
252
253static int vidioc_s_frequency(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300254 struct v4l2_frequency *f)
255{
Hans Verkuile697e122009-03-06 13:48:18 -0300256 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300257
Hans Verkuile697e122009-03-06 13:48:18 -0300258 az_setfreq(az, f->frequency);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300259 return 0;
260}
261
Hans Verkuile697e122009-03-06 13:48:18 -0300262static int vidioc_g_frequency(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300263 struct v4l2_frequency *f)
264{
Hans Verkuile697e122009-03-06 13:48:18 -0300265 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300266
267 f->type = V4L2_TUNER_RADIO;
268 f->frequency = az->curfreq;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300269 return 0;
270}
271
Hans Verkuile697e122009-03-06 13:48:18 -0300272static int vidioc_queryctrl(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300273 struct v4l2_queryctrl *qc)
274{
Hans Verkuile697e122009-03-06 13:48:18 -0300275 switch (qc->id) {
276 case V4L2_CID_AUDIO_MUTE:
277 return v4l2_ctrl_query_fill(qc, 0, 1, 1, 1);
278 case V4L2_CID_AUDIO_VOLUME:
279 return v4l2_ctrl_query_fill(qc, 0, 0xff, 1, 0xff);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300280 }
281 return -EINVAL;
282}
283
Hans Verkuile697e122009-03-06 13:48:18 -0300284static int vidioc_g_ctrl(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300285 struct v4l2_control *ctrl)
286{
Hans Verkuile697e122009-03-06 13:48:18 -0300287 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300288
289 switch (ctrl->id) {
Hans Verkuile697e122009-03-06 13:48:18 -0300290 case V4L2_CID_AUDIO_MUTE:
291 if (az->curvol == 0)
292 ctrl->value = 1;
293 else
294 ctrl->value = 0;
295 return 0;
296 case V4L2_CID_AUDIO_VOLUME:
297 ctrl->value = az->curvol * 6554;
298 return 0;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300299 }
300 return -EINVAL;
301}
302
Hans Verkuile697e122009-03-06 13:48:18 -0300303static int vidioc_s_ctrl(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300304 struct v4l2_control *ctrl)
305{
Hans Verkuile697e122009-03-06 13:48:18 -0300306 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300307
308 switch (ctrl->id) {
Hans Verkuile697e122009-03-06 13:48:18 -0300309 case V4L2_CID_AUDIO_MUTE:
310 if (ctrl->value)
311 az_setvol(az, 0);
312 else
313 az_setvol(az, az->curvol);
314 return 0;
315 case V4L2_CID_AUDIO_VOLUME:
316 az_setvol(az, ctrl->value);
317 return 0;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300318 }
319 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320}
321
Hans Verkuile697e122009-03-06 13:48:18 -0300322static int aztech_open(struct file *file)
Hans Verkuil3ca685a2008-08-23 04:49:13 -0300323{
Hans Verkuile697e122009-03-06 13:48:18 -0300324 return 0;
Hans Verkuil3ca685a2008-08-23 04:49:13 -0300325}
326
Hans Verkuile697e122009-03-06 13:48:18 -0300327static int aztech_release(struct file *file)
Hans Verkuil3ca685a2008-08-23 04:49:13 -0300328{
Hans Verkuil3ca685a2008-08-23 04:49:13 -0300329 return 0;
330}
331
Hans Verkuilbec43662008-12-30 06:58:20 -0300332static const struct v4l2_file_operations aztech_fops = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333 .owner = THIS_MODULE,
Hans Verkuile697e122009-03-06 13:48:18 -0300334 .open = aztech_open,
335 .release = aztech_release,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300336 .ioctl = video_ioctl2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337};
338
Hans Verkuila3998102008-07-21 02:57:38 -0300339static const struct v4l2_ioctl_ops aztech_ioctl_ops = {
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300340 .vidioc_querycap = vidioc_querycap,
341 .vidioc_g_tuner = vidioc_g_tuner,
342 .vidioc_s_tuner = vidioc_s_tuner,
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300343 .vidioc_g_audio = vidioc_g_audio,
344 .vidioc_s_audio = vidioc_s_audio,
Mauro Carvalho Chehaba0c05ab2007-01-25 16:48:13 -0300345 .vidioc_g_input = vidioc_g_input,
346 .vidioc_s_input = vidioc_s_input,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300347 .vidioc_g_frequency = vidioc_g_frequency,
348 .vidioc_s_frequency = vidioc_s_frequency,
349 .vidioc_queryctrl = vidioc_queryctrl,
350 .vidioc_g_ctrl = vidioc_g_ctrl,
351 .vidioc_s_ctrl = vidioc_s_ctrl,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352};
353
354static int __init aztech_init(void)
355{
Hans Verkuile697e122009-03-06 13:48:18 -0300356 struct aztech *az = &aztech_card;
357 struct v4l2_device *v4l2_dev = &az->v4l2_dev;
358 int res;
359
360 strlcpy(v4l2_dev->name, "aztech", sizeof(v4l2_dev->name));
361 az->io = io;
362
363 if (az->io == -1) {
364 v4l2_err(v4l2_dev, "you must set an I/O address with io=0x???\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365 return -EINVAL;
366 }
367
Hans Verkuile697e122009-03-06 13:48:18 -0300368 if (!request_region(az->io, 2, "aztech")) {
369 v4l2_err(v4l2_dev, "port 0x%x already in use\n", az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 return -EBUSY;
371 }
372
Hans Verkuile697e122009-03-06 13:48:18 -0300373 res = v4l2_device_register(NULL, v4l2_dev);
374 if (res < 0) {
375 release_region(az->io, 2);
376 v4l2_err(v4l2_dev, "Could not register v4l2_device\n");
377 return res;
378 }
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300379
Hans Verkuile697e122009-03-06 13:48:18 -0300380 mutex_init(&az->lock);
381 strlcpy(az->vdev.name, v4l2_dev->name, sizeof(az->vdev.name));
382 az->vdev.v4l2_dev = v4l2_dev;
383 az->vdev.fops = &aztech_fops;
384 az->vdev.ioctl_ops = &aztech_ioctl_ops;
385 az->vdev.release = video_device_release_empty;
386 video_set_drvdata(&az->vdev, az);
387
388 if (video_register_device(&az->vdev, VFL_TYPE_RADIO, radio_nr) < 0) {
389 v4l2_device_unregister(v4l2_dev);
390 release_region(az->io, 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391 return -EINVAL;
392 }
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300393
Hans Verkuile697e122009-03-06 13:48:18 -0300394 v4l2_info(v4l2_dev, "Aztech radio card driver v1.00/19990224 rkroll@exploits.org\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 /* mute card - prevents noisy bootups */
Hans Verkuile697e122009-03-06 13:48:18 -0300396 outb(0, az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397 return 0;
398}
399
Hans Verkuile697e122009-03-06 13:48:18 -0300400static void __exit aztech_exit(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401{
Hans Verkuile697e122009-03-06 13:48:18 -0300402 struct aztech *az = &aztech_card;
403
404 video_unregister_device(&az->vdev);
405 v4l2_device_unregister(&az->v4l2_dev);
406 release_region(az->io, 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407}
408
409module_init(aztech_init);
Hans Verkuile697e122009-03-06 13:48:18 -0300410module_exit(aztech_exit);