Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Guillemot Maxi Radio FM 2000 PCI radio card driver for Linux |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * (C) 2001 Dimitromanolakis Apostolos <apdim@grecian.net> |
| 4 | * |
| 5 | * Based in the radio Maestro PCI driver. Actually it uses the same chip |
| 6 | * for radio but different pci controller. |
| 7 | * |
| 8 | * I didn't have any specs I reversed engineered the protocol from |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 9 | * the windows driver (radio.dll). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * |
| 11 | * The card uses the TEA5757 chip that includes a search function but it |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 12 | * is useless as I haven't found any way to read back the frequency. If |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | * anybody does please mail me. |
| 14 | * |
| 15 | * For the pdf file see: |
| 16 | * http://www.semiconductors.philips.com/pip/TEA5757H/V1 |
| 17 | * |
| 18 | * |
| 19 | * CHANGES: |
| 20 | * 0.75b |
| 21 | * - better pci interface thanks to Francois Romieu <romieu@cogenit.fr> |
| 22 | * |
Mauro Carvalho Chehab | e84fef6 | 2006-08-08 09:10:05 -0300 | [diff] [blame] | 23 | * 0.75 Sun Feb 4 22:51:27 EET 2001 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | * - tiding up |
| 25 | * - removed support for multiple devices as it didn't work anyway |
| 26 | * |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 27 | * BUGS: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | * - card unmutes if you change frequency |
| 29 | * |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 30 | * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@infradead.org>: |
| 31 | * - Conversion to V4L2 API |
| 32 | * - Uses video_ioctl2 for parsing and to add debug support |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | */ |
| 34 | |
| 35 | |
| 36 | #include <linux/module.h> |
| 37 | #include <linux/init.h> |
| 38 | #include <linux/ioport.h> |
| 39 | #include <linux/delay.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #include <asm/io.h> |
| 41 | #include <asm/uaccess.h> |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 42 | #include <linux/mutex.h> |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <linux/pci.h> |
Mauro Carvalho Chehab | e84fef6 | 2006-08-08 09:10:05 -0300 | [diff] [blame] | 45 | #include <linux/videodev2.h> |
Mauro Carvalho Chehab | 5e87efa | 2006-06-05 10:26:32 -0300 | [diff] [blame] | 46 | #include <media/v4l2-common.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
Mauro Carvalho Chehab | e84fef6 | 2006-08-08 09:10:05 -0300 | [diff] [blame] | 48 | #define DRIVER_VERSION "0.76" |
| 49 | |
| 50 | #include <linux/version.h> /* for KERNEL_VERSION MACRO */ |
| 51 | #define RADIO_VERSION KERNEL_VERSION(0,7,6) |
| 52 | |
| 53 | static struct v4l2_queryctrl radio_qctrl[] = { |
| 54 | { |
| 55 | .id = V4L2_CID_AUDIO_MUTE, |
| 56 | .name = "Mute", |
| 57 | .minimum = 0, |
| 58 | .maximum = 1, |
| 59 | .default_value = 1, |
| 60 | .type = V4L2_CTRL_TYPE_BOOLEAN, |
| 61 | } |
| 62 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
| 64 | #ifndef PCI_VENDOR_ID_GUILLEMOT |
| 65 | #define PCI_VENDOR_ID_GUILLEMOT 0x5046 |
| 66 | #endif |
| 67 | |
| 68 | #ifndef PCI_DEVICE_ID_GUILLEMOT |
| 69 | #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001 |
| 70 | #endif |
| 71 | |
| 72 | |
| 73 | /* TEA5757 pin mappings */ |
| 74 | static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16 ; |
| 75 | |
| 76 | static int radio_nr = -1; |
| 77 | module_param(radio_nr, int, 0); |
| 78 | |
| 79 | |
| 80 | #define FREQ_LO 50*16000 |
| 81 | #define FREQ_HI 150*16000 |
| 82 | |
| 83 | #define FREQ_IF 171200 /* 10.7*16000 */ |
| 84 | #define FREQ_STEP 200 /* 12.5*16 */ |
| 85 | |
| 86 | #define FREQ2BITS(x) ((( (unsigned int)(x)+FREQ_IF+(FREQ_STEP<<1))\ |
| 87 | /(FREQ_STEP<<2))<<2) /* (x==fmhz*16*1000) -> bits */ |
| 88 | |
| 89 | #define BITS2FREQ(x) ((x) * FREQ_STEP - FREQ_IF) |
| 90 | |
| 91 | |
Arjan van de Ven | fa027c2 | 2007-02-12 00:55:33 -0800 | [diff] [blame] | 92 | static const struct file_operations maxiradio_fops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | .owner = THIS_MODULE, |
| 94 | .open = video_exclusive_open, |
| 95 | .release = video_exclusive_release, |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 96 | .ioctl = video_ioctl2, |
Arnd Bergmann | 0d0fbf8 | 2006-01-09 15:24:57 -0200 | [diff] [blame] | 97 | .compat_ioctl = v4l_compat_ioctl32, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | .llseek = no_llseek, |
| 99 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | |
| 101 | static struct radio_device |
| 102 | { |
| 103 | __u16 io, /* base of radio io */ |
| 104 | muted, /* VIDEO_AUDIO_MUTE */ |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 105 | stereo, /* VIDEO_TUNER_STEREO_ON */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | tuned; /* signal strength (0 or 0xffff) */ |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 107 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | unsigned long freq; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 109 | |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 110 | struct mutex lock; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | } radio_unit = {0, 0, 0, 0, }; |
| 112 | |
| 113 | |
| 114 | static void outbit(unsigned long bit, __u16 io) |
| 115 | { |
| 116 | if(bit != 0) |
| 117 | { |
| 118 | outb( power|wren|data ,io); udelay(4); |
| 119 | outb( power|wren|data|clk ,io); udelay(4); |
| 120 | outb( power|wren|data ,io); udelay(4); |
| 121 | } |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 122 | else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | { |
| 124 | outb( power|wren ,io); udelay(4); |
| 125 | outb( power|wren|clk ,io); udelay(4); |
| 126 | outb( power|wren ,io); udelay(4); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | static void turn_power(__u16 io, int p) |
| 131 | { |
| 132 | if(p != 0) outb(power, io); else outb(0,io); |
| 133 | } |
| 134 | |
| 135 | |
| 136 | static void set_freq(__u16 io, __u32 data) |
| 137 | { |
| 138 | unsigned long int si; |
| 139 | int bl; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 140 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | /* TEA5757 shift register bits (see pdf) */ |
| 142 | |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 143 | outbit(0,io); // 24 search |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | outbit(1,io); // 23 search up/down |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 145 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | outbit(0,io); // 22 stereo/mono |
| 147 | |
| 148 | outbit(0,io); // 21 band |
| 149 | outbit(0,io); // 20 band (only 00=FM works I think) |
| 150 | |
| 151 | outbit(0,io); // 19 port ? |
| 152 | outbit(0,io); // 18 port ? |
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 | outbit(0,io); // 17 search level |
| 155 | outbit(0,io); // 16 search level |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 156 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | si = 0x8000; |
| 158 | for(bl = 1; bl <= 16 ; bl++) { outbit(data & si,io); si >>=1; } |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 159 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | outb(power,io); |
| 161 | } |
| 162 | |
| 163 | static int get_stereo(__u16 io) |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 164 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | outb(power,io); udelay(4); |
| 166 | return !(inb(io) & mo_st); |
| 167 | } |
| 168 | |
| 169 | static int get_tune(__u16 io) |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 170 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | outb(power+clk,io); udelay(4); |
| 172 | return !(inb(io) & mo_st); |
| 173 | } |
| 174 | |
| 175 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 176 | static int vidioc_querycap (struct file *file, void *priv, |
| 177 | struct v4l2_capability *v) |
| 178 | { |
| 179 | strlcpy(v->driver, "radio-maxiradio", sizeof (v->driver)); |
| 180 | strlcpy(v->card, "Maxi Radio FM2000 radio", sizeof (v->card)); |
| 181 | sprintf(v->bus_info,"ISA"); |
| 182 | v->version = RADIO_VERSION; |
| 183 | v->capabilities = V4L2_CAP_TUNER; |
| 184 | |
| 185 | return 0; |
| 186 | } |
| 187 | |
| 188 | static int vidioc_g_tuner (struct file *file, void *priv, |
| 189 | struct v4l2_tuner *v) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | { |
| 191 | struct video_device *dev = video_devdata(file); |
| 192 | struct radio_device *card=dev->priv; |
| 193 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 194 | if (v->index > 0) |
| 195 | return -EINVAL; |
Mauro Carvalho Chehab | e84fef6 | 2006-08-08 09:10:05 -0300 | [diff] [blame] | 196 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 197 | memset(v,0,sizeof(*v)); |
| 198 | strcpy(v->name, "FM"); |
| 199 | v->type = V4L2_TUNER_RADIO; |
| 200 | |
| 201 | v->rangelow=FREQ_LO; |
| 202 | v->rangehigh=FREQ_HI; |
| 203 | v->rxsubchans =V4L2_TUNER_SUB_MONO|V4L2_TUNER_SUB_STEREO; |
| 204 | v->capability=V4L2_TUNER_CAP_LOW; |
| 205 | if(get_stereo(card->io)) |
| 206 | v->audmode = V4L2_TUNER_MODE_STEREO; |
| 207 | else |
| 208 | v->audmode = V4L2_TUNER_MODE_MONO; |
| 209 | v->signal=0xffff*get_tune(card->io); |
| 210 | |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | static int vidioc_s_tuner (struct file *file, void *priv, |
| 215 | struct v4l2_tuner *v) |
| 216 | { |
| 217 | if (v->index > 0) |
| 218 | return -EINVAL; |
| 219 | |
| 220 | return 0; |
| 221 | } |
| 222 | |
| 223 | static int vidioc_s_frequency (struct file *file, void *priv, |
| 224 | struct v4l2_frequency *f) |
| 225 | { |
| 226 | struct video_device *dev = video_devdata(file); |
| 227 | struct radio_device *card=dev->priv; |
| 228 | |
| 229 | if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) |
| 230 | return -EINVAL; |
| 231 | |
| 232 | card->freq = f->frequency; |
| 233 | set_freq(card->io, FREQ2BITS(card->freq)); |
| 234 | msleep(125); |
| 235 | |
| 236 | return 0; |
| 237 | } |
| 238 | |
| 239 | static int vidioc_g_frequency (struct file *file, void *priv, |
| 240 | struct v4l2_frequency *f) |
| 241 | { |
| 242 | struct video_device *dev = video_devdata(file); |
| 243 | struct radio_device *card=dev->priv; |
| 244 | |
| 245 | f->type = V4L2_TUNER_RADIO; |
| 246 | f->frequency = card->freq; |
| 247 | |
| 248 | return 0; |
| 249 | } |
| 250 | |
| 251 | static int vidioc_queryctrl (struct file *file, void *priv, |
| 252 | struct v4l2_queryctrl *qc) |
| 253 | { |
| 254 | int i; |
| 255 | |
| 256 | for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { |
| 257 | if (qc->id && qc->id == radio_qctrl[i].id) { |
| 258 | memcpy(qc, &(radio_qctrl[i]), sizeof(*qc)); |
| 259 | return (0); |
Mauro Carvalho Chehab | e84fef6 | 2006-08-08 09:10:05 -0300 | [diff] [blame] | 260 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | } |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 262 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | } |
| 264 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 265 | static int vidioc_g_ctrl (struct file *file, void *priv, |
| 266 | struct v4l2_control *ctrl) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | { |
| 268 | struct video_device *dev = video_devdata(file); |
| 269 | struct radio_device *card=dev->priv; |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 270 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 271 | switch (ctrl->id) { |
| 272 | case V4L2_CID_AUDIO_MUTE: |
| 273 | ctrl->value=card->muted; |
| 274 | return (0); |
| 275 | } |
| 276 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | } |
| 278 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 279 | static int vidioc_s_ctrl (struct file *file, void *priv, |
| 280 | struct v4l2_control *ctrl) |
| 281 | { |
| 282 | struct video_device *dev = video_devdata(file); |
| 283 | struct radio_device *card=dev->priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 285 | switch (ctrl->id) { |
| 286 | case V4L2_CID_AUDIO_MUTE: |
| 287 | card->muted = ctrl->value; |
| 288 | if(card->muted) |
| 289 | turn_power(card->io, 0); |
| 290 | else |
| 291 | set_freq(card->io, FREQ2BITS(card->freq)); |
| 292 | return 0; |
| 293 | } |
| 294 | return -EINVAL; |
| 295 | } |
| 296 | |
| 297 | static struct video_device maxiradio_radio = |
| 298 | { |
| 299 | .owner = THIS_MODULE, |
| 300 | .name = "Maxi Radio FM2000 radio", |
| 301 | .type = VID_TYPE_TUNER, |
| 302 | .fops = &maxiradio_fops, |
| 303 | |
| 304 | .vidioc_querycap = vidioc_querycap, |
| 305 | .vidioc_g_tuner = vidioc_g_tuner, |
| 306 | .vidioc_s_tuner = vidioc_s_tuner, |
| 307 | .vidioc_g_frequency = vidioc_g_frequency, |
| 308 | .vidioc_s_frequency = vidioc_s_frequency, |
| 309 | .vidioc_queryctrl = vidioc_queryctrl, |
| 310 | .vidioc_g_ctrl = vidioc_g_ctrl, |
| 311 | .vidioc_s_ctrl = vidioc_s_ctrl, |
| 312 | |
| 313 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | |
| 315 | static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
| 316 | { |
| 317 | if(!request_region(pci_resource_start(pdev, 0), |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 318 | pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) { |
| 319 | printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n"); |
| 320 | goto err_out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | if (pci_enable_device(pdev)) |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 324 | goto err_out_free_region; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 325 | |
| 326 | radio_unit.io = pci_resource_start(pdev, 0); |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 327 | mutex_init(&radio_unit.lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | maxiradio_radio.priv = &radio_unit; |
| 329 | |
| 330 | if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) { |
Mauro Carvalho Chehab | 4286c6f | 2006-04-08 16:06:16 -0300 | [diff] [blame] | 331 | printk("radio-maxiradio: can't register device!"); |
| 332 | goto err_out_free_region; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | printk(KERN_INFO "radio-maxiradio: version " |
| 336 | DRIVER_VERSION |
| 337 | " time " |
| 338 | __TIME__ " " |
| 339 | __DATE__ |
| 340 | "\n"); |
| 341 | |
| 342 | printk(KERN_INFO "radio-maxiradio: found Guillemot MAXI Radio device (io = 0x%x)\n", |
| 343 | radio_unit.io); |
| 344 | return 0; |
| 345 | |
| 346 | err_out_free_region: |
| 347 | release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); |
| 348 | err_out: |
| 349 | return -ENODEV; |
| 350 | } |
| 351 | |
| 352 | static void __devexit maxiradio_remove_one(struct pci_dev *pdev) |
| 353 | { |
| 354 | video_unregister_device(&maxiradio_radio); |
| 355 | release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); |
| 356 | } |
| 357 | |
| 358 | static struct pci_device_id maxiradio_pci_tbl[] = { |
| 359 | { PCI_VENDOR_ID_GUILLEMOT, PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO, |
| 360 | PCI_ANY_ID, PCI_ANY_ID, }, |
| 361 | { 0,} |
| 362 | }; |
| 363 | |
| 364 | MODULE_DEVICE_TABLE(pci, maxiradio_pci_tbl); |
| 365 | |
| 366 | static struct pci_driver maxiradio_driver = { |
| 367 | .name = "radio-maxiradio", |
| 368 | .id_table = maxiradio_pci_tbl, |
| 369 | .probe = maxiradio_init_one, |
| 370 | .remove = __devexit_p(maxiradio_remove_one), |
| 371 | }; |
| 372 | |
| 373 | static int __init maxiradio_radio_init(void) |
| 374 | { |
Richard Knutsson | 9bfab8c | 2005-11-30 00:59:34 +0100 | [diff] [blame] | 375 | return pci_register_driver(&maxiradio_driver); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | static void __exit maxiradio_radio_exit(void) |
| 379 | { |
| 380 | pci_unregister_driver(&maxiradio_driver); |
| 381 | } |
| 382 | |
| 383 | module_init(maxiradio_radio_init); |
| 384 | module_exit(maxiradio_radio_exit); |
Mauro Carvalho Chehab | 06470ed | 2007-01-25 09:04:34 -0300 | [diff] [blame^] | 385 | |
| 386 | MODULE_AUTHOR("Dimitromanolakis Apostolos, apdim@grecian.net"); |
| 387 | MODULE_DESCRIPTION("Radio driver for the Guillemot Maxi Radio FM2000 radio."); |
| 388 | MODULE_LICENSE("GPL"); |
| 389 | |
| 390 | module_param_named(debug,maxiradio_radio.debug, int, 0644); |
| 391 | MODULE_PARM_DESC(debug,"activates debug info"); |