blob: c22311393624d26ebfbe0d4db8776a7c536b3a70 [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 */
Hans Verkuile697e122009-03-06 13:48:18 -030035#include <media/v4l2-device.h>
Hans Verkuil35ea11f2008-07-20 08:12:02 -030036#include <media/v4l2-ioctl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Hans Verkuile697e122009-03-06 13:48:18 -030038MODULE_AUTHOR("Russell Kroll, Quay Lu, Donald Song, Jason Lewis, Scott McGrath, William McGrath");
39MODULE_DESCRIPTION("A driver for the Aztech radio card.");
40MODULE_LICENSE("GPL");
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -030041
Linus Torvalds1da177e2005-04-16 15:20:36 -070042/* acceptable ports: 0x350 (JP3 shorted), 0x358 (JP3 open) */
43
44#ifndef CONFIG_RADIO_AZTECH_PORT
45#define CONFIG_RADIO_AZTECH_PORT -1
46#endif
47
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -030048static int io = CONFIG_RADIO_AZTECH_PORT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049static int radio_nr = -1;
50static int radio_wait_time = 1000;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Hans Verkuile697e122009-03-06 13:48:18 -030052module_param(io, int, 0);
53module_param(radio_nr, int, 0);
54MODULE_PARM_DESC(io, "I/O address of the Aztech card (0x350 or 0x358)");
55
56#define RADIO_VERSION KERNEL_VERSION(0, 0, 2)
57
58struct aztech
Linus Torvalds1da177e2005-04-16 15:20:36 -070059{
Hans Verkuile697e122009-03-06 13:48:18 -030060 struct v4l2_device v4l2_dev;
61 struct video_device vdev;
62 int io;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 int curvol;
64 unsigned long curfreq;
65 int stereo;
Hans Verkuile697e122009-03-06 13:48:18 -030066 struct mutex lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -070067};
68
Hans Verkuile697e122009-03-06 13:48:18 -030069static struct aztech aztech_card;
70
Linus Torvalds1da177e2005-04-16 15:20:36 -070071static int volconvert(int level)
72{
Hans Verkuile697e122009-03-06 13:48:18 -030073 level >>= 14; /* Map 16bits down to 2 bit */
74 level &= 3;
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -030075
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 /* convert to card-friendly values */
Hans Verkuile697e122009-03-06 13:48:18 -030077 switch (level) {
78 case 0:
79 return 0;
80 case 1:
81 return 1;
82 case 2:
83 return 4;
84 case 3:
85 return 5;
Linus Torvalds1da177e2005-04-16 15:20:36 -070086 }
87 return 0; /* Quieten gcc */
88}
89
Hans Verkuile697e122009-03-06 13:48:18 -030090static void send_0_byte(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -070091{
92 udelay(radio_wait_time);
Hans Verkuile697e122009-03-06 13:48:18 -030093 outb_p(2 + volconvert(az->curvol), az->io);
94 outb_p(64 + 2 + volconvert(az->curvol), az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -070095}
96
Hans Verkuile697e122009-03-06 13:48:18 -030097static void send_1_byte(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -070098{
99 udelay (radio_wait_time);
Hans Verkuile697e122009-03-06 13:48:18 -0300100 outb_p(128 + 2 + volconvert(az->curvol), az->io);
101 outb_p(128 + 64 + 2 + volconvert(az->curvol), az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102}
103
Hans Verkuile697e122009-03-06 13:48:18 -0300104static int az_setvol(struct aztech *az, int vol)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105{
Hans Verkuile697e122009-03-06 13:48:18 -0300106 mutex_lock(&az->lock);
107 outb(volconvert(vol), az->io);
108 mutex_unlock(&az->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 return 0;
110}
111
112/* thanks to Michael Dwyer for giving me a dose of clues in
113 * the signal strength department..
114 *
115 * This card has a stereo bit - bit 0 set = mono, not set = stereo
116 * It also has a "signal" bit - bit 1 set = bad signal, not set = good
117 *
118 */
119
Hans Verkuile697e122009-03-06 13:48:18 -0300120static int az_getsigstr(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121{
Hans Verkuile697e122009-03-06 13:48:18 -0300122 int sig = 1;
123
124 mutex_lock(&az->lock);
125 if (inb(az->io) & 2) /* bit set = no signal present */
126 sig = 0;
127 mutex_unlock(&az->lock);
128 return sig;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129}
130
Hans Verkuile697e122009-03-06 13:48:18 -0300131static int az_getstereo(struct aztech *az)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132{
Hans Verkuile697e122009-03-06 13:48:18 -0300133 int stereo = 1;
134
135 mutex_lock(&az->lock);
136 if (inb(az->io) & 1) /* bit set = mono */
137 stereo = 0;
138 mutex_unlock(&az->lock);
139 return stereo;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140}
141
Hans Verkuile697e122009-03-06 13:48:18 -0300142static int az_setfreq(struct aztech *az, unsigned long frequency)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143{
144 int i;
145
Hans Verkuile697e122009-03-06 13:48:18 -0300146 mutex_lock(&az->lock);
147
148 az->curfreq = frequency;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 frequency += 171200; /* Add 10.7 MHz IF */
150 frequency /= 800; /* Convert to 50 kHz units */
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300151
Hans Verkuile697e122009-03-06 13:48:18 -0300152 send_0_byte(az); /* 0: LSB of frequency */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153
154 for (i = 0; i < 13; i++) /* : frequency bits (1-13) */
155 if (frequency & (1 << i))
Hans Verkuile697e122009-03-06 13:48:18 -0300156 send_1_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 else
Hans Verkuile697e122009-03-06 13:48:18 -0300158 send_0_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159
Hans Verkuile697e122009-03-06 13:48:18 -0300160 send_0_byte(az); /* 14: test bit - always 0 */
161 send_0_byte(az); /* 15: test bit - always 0 */
162 send_0_byte(az); /* 16: band data 0 - always 0 */
163 if (az->stereo) /* 17: stereo (1 to enable) */
164 send_1_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 else
Hans Verkuile697e122009-03-06 13:48:18 -0300166 send_0_byte(az);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
Hans Verkuile697e122009-03-06 13:48:18 -0300168 send_1_byte(az); /* 18: band data 1 - unknown */
169 send_0_byte(az); /* 19: time base - always 0 */
170 send_0_byte(az); /* 20: spacing (0 = 25 kHz) */
171 send_1_byte(az); /* 21: spacing (1 = 25 kHz) */
172 send_0_byte(az); /* 22: spacing (0 = 25 kHz) */
173 send_1_byte(az); /* 23: AM/FM (FM = 1, always) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174
175 /* latch frequency */
176
Hans Verkuile697e122009-03-06 13:48:18 -0300177 udelay(radio_wait_time);
178 outb_p(128 + 64 + volconvert(az->curvol), az->io);
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300179
Hans Verkuile697e122009-03-06 13:48:18 -0300180 mutex_unlock(&az->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
182 return 0;
183}
184
Hans Verkuile697e122009-03-06 13:48:18 -0300185static int vidioc_querycap(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300186 struct v4l2_capability *v)
187{
Hans Verkuile697e122009-03-06 13:48:18 -0300188 strlcpy(v->driver, "radio-aztech", sizeof(v->driver));
189 strlcpy(v->card, "Aztech Radio", sizeof(v->card));
190 strlcpy(v->bus_info, "ISA", sizeof(v->bus_info));
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300191 v->version = RADIO_VERSION;
Hans Verkuile697e122009-03-06 13:48:18 -0300192 v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300193 return 0;
194}
195
Hans Verkuile697e122009-03-06 13:48:18 -0300196static int vidioc_g_tuner(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300197 struct v4l2_tuner *v)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198{
Hans Verkuile697e122009-03-06 13:48:18 -0300199 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300200
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300201 if (v->index > 0)
202 return -EINVAL;
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -0300203
Hans Verkuile697e122009-03-06 13:48:18 -0300204 strlcpy(v->name, "FM", sizeof(v->name));
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300205 v->type = V4L2_TUNER_RADIO;
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -0300206
Hans Verkuile697e122009-03-06 13:48:18 -0300207 v->rangelow = 87 * 16000;
208 v->rangehigh = 108 * 16000;
209 v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
210 v->capability = V4L2_TUNER_CAP_LOW;
211 if (az_getstereo(az))
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300212 v->audmode = V4L2_TUNER_MODE_STEREO;
213 else
214 v->audmode = V4L2_TUNER_MODE_MONO;
Hans Verkuile697e122009-03-06 13:48:18 -0300215 v->signal = 0xFFFF * az_getsigstr(az);
Mauro Carvalho Chehaba4366af2006-08-08 09:10:01 -0300216
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300217 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218}
219
Hans Verkuile697e122009-03-06 13:48:18 -0300220static int vidioc_s_tuner(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300221 struct v4l2_tuner *v)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222{
Hans Verkuile697e122009-03-06 13:48:18 -0300223 return v->index ? -EINVAL : 0;
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300224}
225
Mauro Carvalho Chehaba0c05ab2007-01-25 16:48:13 -0300226static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
227{
228 *i = 0;
229 return 0;
230}
231
232static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
233{
Hans Verkuile697e122009-03-06 13:48:18 -0300234 return i ? -EINVAL : 0;
Mauro Carvalho Chehaba0c05ab2007-01-25 16:48:13 -0300235}
236
Hans Verkuile697e122009-03-06 13:48:18 -0300237static int vidioc_g_audio(struct file *file, void *priv,
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300238 struct v4l2_audio *a)
239{
Hans Verkuile697e122009-03-06 13:48:18 -0300240 a->index = 0;
241 strlcpy(a->name, "Radio", sizeof(a->name));
242 a->capability = V4L2_AUDCAP_STEREO;
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300243 return 0;
244}
245
Hans Verkuile697e122009-03-06 13:48:18 -0300246static int vidioc_s_audio(struct file *file, void *priv,
247 struct v4l2_audio *a)
248{
249 return a->index ? -EINVAL : 0;
250}
251
252static int vidioc_s_frequency(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300253 struct v4l2_frequency *f)
254{
Hans Verkuile697e122009-03-06 13:48:18 -0300255 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300256
Hans Verkuila3a9e282009-11-27 04:33:25 -0300257 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
258 return -EINVAL;
Hans Verkuile697e122009-03-06 13:48:18 -0300259 az_setfreq(az, f->frequency);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300260 return 0;
261}
262
Hans Verkuile697e122009-03-06 13:48:18 -0300263static int vidioc_g_frequency(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300264 struct v4l2_frequency *f)
265{
Hans Verkuile697e122009-03-06 13:48:18 -0300266 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300267
Hans Verkuila3a9e282009-11-27 04:33:25 -0300268 if (f->tuner != 0)
269 return -EINVAL;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300270 f->type = V4L2_TUNER_RADIO;
271 f->frequency = az->curfreq;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300272 return 0;
273}
274
Hans Verkuile697e122009-03-06 13:48:18 -0300275static int vidioc_queryctrl(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300276 struct v4l2_queryctrl *qc)
277{
Hans Verkuile697e122009-03-06 13:48:18 -0300278 switch (qc->id) {
279 case V4L2_CID_AUDIO_MUTE:
280 return v4l2_ctrl_query_fill(qc, 0, 1, 1, 1);
281 case V4L2_CID_AUDIO_VOLUME:
282 return v4l2_ctrl_query_fill(qc, 0, 0xff, 1, 0xff);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300283 }
284 return -EINVAL;
285}
286
Hans Verkuile697e122009-03-06 13:48:18 -0300287static int vidioc_g_ctrl(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300288 struct v4l2_control *ctrl)
289{
Hans Verkuile697e122009-03-06 13:48:18 -0300290 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300291
292 switch (ctrl->id) {
Hans Verkuile697e122009-03-06 13:48:18 -0300293 case V4L2_CID_AUDIO_MUTE:
294 if (az->curvol == 0)
295 ctrl->value = 1;
296 else
297 ctrl->value = 0;
298 return 0;
299 case V4L2_CID_AUDIO_VOLUME:
300 ctrl->value = az->curvol * 6554;
301 return 0;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300302 }
303 return -EINVAL;
304}
305
Hans Verkuile697e122009-03-06 13:48:18 -0300306static int vidioc_s_ctrl(struct file *file, void *priv,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300307 struct v4l2_control *ctrl)
308{
Hans Verkuile697e122009-03-06 13:48:18 -0300309 struct aztech *az = video_drvdata(file);
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300310
311 switch (ctrl->id) {
Hans Verkuile697e122009-03-06 13:48:18 -0300312 case V4L2_CID_AUDIO_MUTE:
313 if (ctrl->value)
314 az_setvol(az, 0);
315 else
316 az_setvol(az, az->curvol);
317 return 0;
318 case V4L2_CID_AUDIO_VOLUME:
319 az_setvol(az, ctrl->value);
320 return 0;
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300321 }
322 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323}
324
Hans Verkuilbec43662008-12-30 06:58:20 -0300325static const struct v4l2_file_operations aztech_fops = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326 .owner = THIS_MODULE,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300327 .ioctl = video_ioctl2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328};
329
Hans Verkuila3998102008-07-21 02:57:38 -0300330static const struct v4l2_ioctl_ops aztech_ioctl_ops = {
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300331 .vidioc_querycap = vidioc_querycap,
332 .vidioc_g_tuner = vidioc_g_tuner,
333 .vidioc_s_tuner = vidioc_s_tuner,
Mauro Carvalho Chehab676b0ac2007-01-25 15:10:31 -0300334 .vidioc_g_audio = vidioc_g_audio,
335 .vidioc_s_audio = vidioc_s_audio,
Mauro Carvalho Chehaba0c05ab2007-01-25 16:48:13 -0300336 .vidioc_g_input = vidioc_g_input,
337 .vidioc_s_input = vidioc_s_input,
Mauro Carvalho Chehab99218fe2007-01-25 08:09:32 -0300338 .vidioc_g_frequency = vidioc_g_frequency,
339 .vidioc_s_frequency = vidioc_s_frequency,
340 .vidioc_queryctrl = vidioc_queryctrl,
341 .vidioc_g_ctrl = vidioc_g_ctrl,
342 .vidioc_s_ctrl = vidioc_s_ctrl,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343};
344
345static int __init aztech_init(void)
346{
Hans Verkuile697e122009-03-06 13:48:18 -0300347 struct aztech *az = &aztech_card;
348 struct v4l2_device *v4l2_dev = &az->v4l2_dev;
349 int res;
350
351 strlcpy(v4l2_dev->name, "aztech", sizeof(v4l2_dev->name));
352 az->io = io;
353
354 if (az->io == -1) {
Hans Verkuilb24c20cc2009-03-09 08:11:21 -0300355 v4l2_err(v4l2_dev, "you must set an I/O address with io=0x350 or 0x358\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356 return -EINVAL;
357 }
358
Hans Verkuile697e122009-03-06 13:48:18 -0300359 if (!request_region(az->io, 2, "aztech")) {
360 v4l2_err(v4l2_dev, "port 0x%x already in use\n", az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 return -EBUSY;
362 }
363
Hans Verkuile697e122009-03-06 13:48:18 -0300364 res = v4l2_device_register(NULL, v4l2_dev);
365 if (res < 0) {
366 release_region(az->io, 2);
367 v4l2_err(v4l2_dev, "Could not register v4l2_device\n");
368 return res;
369 }
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300370
Hans Verkuile697e122009-03-06 13:48:18 -0300371 mutex_init(&az->lock);
372 strlcpy(az->vdev.name, v4l2_dev->name, sizeof(az->vdev.name));
373 az->vdev.v4l2_dev = v4l2_dev;
374 az->vdev.fops = &aztech_fops;
375 az->vdev.ioctl_ops = &aztech_ioctl_ops;
376 az->vdev.release = video_device_release_empty;
377 video_set_drvdata(&az->vdev, az);
378
379 if (video_register_device(&az->vdev, VFL_TYPE_RADIO, radio_nr) < 0) {
380 v4l2_device_unregister(v4l2_dev);
381 release_region(az->io, 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382 return -EINVAL;
383 }
Mauro Carvalho Chehab4286c6f2006-04-08 16:06:16 -0300384
Hans Verkuile697e122009-03-06 13:48:18 -0300385 v4l2_info(v4l2_dev, "Aztech radio card driver v1.00/19990224 rkroll@exploits.org\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 /* mute card - prevents noisy bootups */
Hans Verkuile697e122009-03-06 13:48:18 -0300387 outb(0, az->io);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 return 0;
389}
390
Hans Verkuile697e122009-03-06 13:48:18 -0300391static void __exit aztech_exit(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392{
Hans Verkuile697e122009-03-06 13:48:18 -0300393 struct aztech *az = &aztech_card;
394
395 video_unregister_device(&az->vdev);
396 v4l2_device_unregister(&az->v4l2_dev);
397 release_region(az->io, 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398}
399
400module_init(aztech_init);
Hans Verkuile697e122009-03-06 13:48:18 -0300401module_exit(aztech_exit);