blob: db865a0667e5ae8caed0fd9d8f75c879120ce2d0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* A driver for the D-Link DSB-R100 USB radio. The R100 plugs
2 into both the USB and an analog audio input, so this thing
3 only deals with initialisation and frequency setting, the
4 audio data has to be handled by a sound driver.
5
6 Major issue: I can't find out where the device reports the signal
7 strength, and indeed the windows software appearantly just looks
8 at the stereo indicator as well. So, scanning will only find
9 stereo stations. Sad, but I can't help it.
10
11 Also, the windows program sends oodles of messages over to the
12 device, and I couldn't figure out their meaning. My suspicion
13 is that they don't have any:-)
14
15 You might find some interesting stuff about this module at
16 http://unimut.fsk.uni-heidelberg.de/unimut/demi/dsbr
17
18 Copyright (c) 2000 Markus Demleitner <msdemlei@cl.uni-heidelberg.de>
19
20 This program is free software; you can redistribute it and/or modify
21 it under the terms of the GNU General Public License as published by
22 the Free Software Foundation; either version 2 of the License, or
23 (at your option) any later version.
24
25 This program is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 GNU General Public License for more details.
29
30 You should have received a copy of the GNU General Public License
31 along with this program; if not, write to the Free Software
32 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
34 History:
35
Alan Cox5aff3082006-08-08 15:47:50 -030036 Version 0.41-ac1:
37 Alan Cox: Some cleanups and fixes
38
39 Version 0.41:
40 Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
41
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 Version 0.40:
Alan Cox5aff3082006-08-08 15:47:50 -030043 Markus: Updates for 2.6.x kernels, code layout changes, name sanitizing
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45 Version 0.30:
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030046 Markus: Updates for 2.5.x kernel and more ISO compliant source
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48 Version 0.25:
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030049 PSL and Markus: Cleanup, radio now doesn't stop on device close
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51 Version 0.24:
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030052 Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 right. Some minor cleanup, improved standalone compilation
54
55 Version 0.23:
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030056 Markus: Sign extension bug fixed by declaring transfer_buffer unsigned
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58 Version 0.22:
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030059 Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns,
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 thanks to Mike Cox for pointing the problem out.
61
62 Version 0.21:
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030063 Markus: Minor cleanup, warnings if something goes wrong, lame attempt
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 to adhere to Documentation/CodingStyle
65
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -030066 Version 0.2:
67 Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 Markus: Copyright clarification
69
70 Version 0.01: Markus: initial release
71
72*/
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074#include <linux/kernel.h>
75#include <linux/module.h>
76#include <linux/init.h>
77#include <linux/slab.h>
78#include <linux/input.h>
Alan Cox5aff3082006-08-08 15:47:50 -030079#include <linux/videodev2.h>
Mauro Carvalho Chehab5e87efa2006-06-05 10:26:32 -030080#include <media/v4l2-common.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070081#include <linux/usb.h>
82#include <linux/smp_lock.h>
83
84/*
85 * Version Information
86 */
Alan Cox5aff3082006-08-08 15:47:50 -030087#include <linux/version.h> /* for KERNEL_VERSION MACRO */
88
89#define DRIVER_VERSION "v0.41"
90#define RADIO_VERSION KERNEL_VERSION(0,4,1)
91
92static struct v4l2_queryctrl radio_qctrl[] = {
93 {
94 .id = V4L2_CID_AUDIO_MUTE,
95 .name = "Mute",
96 .minimum = 0,
97 .maximum = 1,
98 .default_value = 1,
99 .type = V4L2_CTRL_TYPE_BOOLEAN,
100 }
101};
102
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103#define DRIVER_AUTHOR "Markus Demleitner <msdemlei@tucana.harvard.edu>"
104#define DRIVER_DESC "D-Link DSB-R100 USB FM radio driver"
105
106#define DSB100_VENDOR 0x04b4
107#define DSB100_PRODUCT 0x1002
108
109/* Commands the device appears to understand */
110#define DSB100_TUNE 1
111#define DSB100_ONOFF 2
112
113#define TB_LEN 16
114
115/* Frequency limits in MHz -- these are European values. For Japanese
116devices, that would be 76 and 91. */
117#define FREQ_MIN 87.5
118#define FREQ_MAX 108.0
119#define FREQ_MUL 16000
120
121
122static int usb_dsbr100_probe(struct usb_interface *intf,
123 const struct usb_device_id *id);
124static void usb_dsbr100_disconnect(struct usb_interface *intf);
125static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
126 unsigned int cmd, unsigned long arg);
127static int usb_dsbr100_open(struct inode *inode, struct file *file);
128static int usb_dsbr100_close(struct inode *inode, struct file *file);
129
130static int radio_nr = -1;
131module_param(radio_nr, int, 0);
132
133/* Data for one (physical) device */
Alan Cox5aff3082006-08-08 15:47:50 -0300134struct dsbr100_device {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 struct usb_device *usbdev;
136 struct video_device *videodev;
137 unsigned char transfer_buffer[TB_LEN];
138 int curfreq;
139 int stereo;
140 int users;
141 int removed;
Alan Cox5aff3082006-08-08 15:47:50 -0300142 int muted;
143};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
145
146/* File system interface */
147static struct file_operations usb_dsbr100_fops = {
148 .owner = THIS_MODULE,
149 .open = usb_dsbr100_open,
150 .release = usb_dsbr100_close,
151 .ioctl = usb_dsbr100_ioctl,
Arnd Bergmann0d0fbf82006-01-09 15:24:57 -0200152 .compat_ioctl = v4l_compat_ioctl32,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 .llseek = no_llseek,
154};
155
156/* V4L interface */
157static struct video_device dsbr100_videodev_template=
158{
159 .owner = THIS_MODULE,
160 .name = "D-Link DSB-R 100",
161 .type = VID_TYPE_TUNER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162 .fops = &usb_dsbr100_fops,
163 .release = video_device_release,
164};
165
166static struct usb_device_id usb_dsbr100_device_table [] = {
167 { USB_DEVICE(DSB100_VENDOR, DSB100_PRODUCT) },
168 { } /* Terminating entry */
169};
170
171MODULE_DEVICE_TABLE (usb, usb_dsbr100_device_table);
172
173/* USB subsystem interface */
174static struct usb_driver usb_dsbr100_driver = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 .name = "dsbr100",
176 .probe = usb_dsbr100_probe,
177 .disconnect = usb_dsbr100_disconnect,
178 .id_table = usb_dsbr100_device_table,
179};
180
181/* Low-level device interface begins here */
182
183/* switch on radio */
Alan Cox5aff3082006-08-08 15:47:50 -0300184static int dsbr100_start(struct dsbr100_device *radio)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185{
186 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300187 USB_REQ_GET_STATUS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
189 0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
190 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300191 DSB100_ONOFF,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
193 0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
194 return -1;
Alan Cox5aff3082006-08-08 15:47:50 -0300195 radio->muted=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 return (radio->transfer_buffer)[0];
197}
198
199
200/* switch off radio */
Alan Cox5aff3082006-08-08 15:47:50 -0300201static int dsbr100_stop(struct dsbr100_device *radio)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202{
203 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300204 USB_REQ_GET_STATUS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
206 0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
207 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300208 DSB100_ONOFF,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
210 0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
211 return -1;
Alan Cox5aff3082006-08-08 15:47:50 -0300212 radio->muted=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 return (radio->transfer_buffer)[0];
214}
215
216/* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
Alan Cox5aff3082006-08-08 15:47:50 -0300217static int dsbr100_setfreq(struct dsbr100_device *radio, int freq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218{
219 freq = (freq/16*80)/1000+856;
220 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300221 DSB100_TUNE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300223 (freq>>8)&0x00ff, freq&0xff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 radio->transfer_buffer, 8, 300)<0 ||
225 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300226 USB_REQ_GET_STATUS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
228 0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
229 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300230 USB_REQ_GET_STATUS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
232 0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
233 radio->stereo = -1;
234 return -1;
235 }
236 radio->stereo = ! ((radio->transfer_buffer)[0]&0x01);
237 return (radio->transfer_buffer)[0];
238}
239
240/* return the device status. This is, in effect, just whether it
241sees a stereo signal or not. Pity. */
Alan Cox5aff3082006-08-08 15:47:50 -0300242static void dsbr100_getstat(struct dsbr100_device *radio)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243{
244 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300245 USB_REQ_GET_STATUS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
247 0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
248 radio->stereo = -1;
249 else
250 radio->stereo = ! (radio->transfer_buffer[0]&0x01);
251}
252
253
254/* USB subsystem interface begins here */
255
256/* check if the device is present and register with v4l and
257usb if it is */
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300258static int usb_dsbr100_probe(struct usb_interface *intf,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 const struct usb_device_id *id)
260{
Alan Cox5aff3082006-08-08 15:47:50 -0300261 struct dsbr100_device *radio;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
Alan Cox5aff3082006-08-08 15:47:50 -0300263 if (!(radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264 return -ENOMEM;
265 if (!(radio->videodev = video_device_alloc())) {
266 kfree(radio);
267 return -ENOMEM;
268 }
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300269 memcpy(radio->videodev, &dsbr100_videodev_template,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270 sizeof(dsbr100_videodev_template));
271 radio->removed = 0;
272 radio->users = 0;
273 radio->usbdev = interface_to_usbdev(intf);
274 radio->curfreq = FREQ_MIN*FREQ_MUL;
275 video_set_drvdata(radio->videodev, radio);
276 if (video_register_device(radio->videodev, VFL_TYPE_RADIO,
277 radio_nr)) {
278 warn("Could not register video device");
279 video_device_release(radio->videodev);
280 kfree(radio);
281 return -EIO;
282 }
283 usb_set_intfdata(intf, radio);
284 return 0;
285}
286
287/* handle unplugging of the device, release data structures
288if nothing keeps us from doing it. If something is still
289keeping us busy, the release callback of v4l will take care
290of releasing it. stv680.c does not relase its private
291data, so I don't do this here either. Checking out the
292code I'd expect I better did that, but if there's a memory
293leak here it's tiny (~50 bytes per disconnect) */
294static void usb_dsbr100_disconnect(struct usb_interface *intf)
295{
Alan Cox5aff3082006-08-08 15:47:50 -0300296 struct dsbr100_device *radio = usb_get_intfdata(intf);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297
298 usb_set_intfdata (intf, NULL);
299 if (radio) {
300 video_unregister_device(radio->videodev);
301 radio->videodev = NULL;
302 if (radio->users) {
303 kfree(radio);
304 } else {
305 radio->removed = 1;
306 }
307 }
308}
309
310
311/* Video for Linux interface */
312
313static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
314 unsigned int cmd, void *arg)
315{
Alan Cox5aff3082006-08-08 15:47:50 -0300316 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317
318 if (!radio)
319 return -EIO;
320
321 switch(cmd) {
Alan Cox5aff3082006-08-08 15:47:50 -0300322 case VIDIOC_QUERYCAP:
323 {
324 struct v4l2_capability *v = arg;
325 memset(v,0,sizeof(*v));
326 strlcpy(v->driver, "dsbr100", sizeof (v->driver));
327 strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof (v->card));
328 sprintf(v->bus_info,"ISA");
329 v->version = RADIO_VERSION;
330 v->capabilities = V4L2_CAP_TUNER;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332 return 0;
333 }
Alan Cox5aff3082006-08-08 15:47:50 -0300334 case VIDIOC_G_TUNER:
335 {
336 struct v4l2_tuner *v = arg;
337
338 if (v->index > 0)
339 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340
341 dsbr100_getstat(radio);
Alan Cox5aff3082006-08-08 15:47:50 -0300342
343 memset(v,0,sizeof(*v));
344 strcpy(v->name, "FM");
345 v->type = V4L2_TUNER_RADIO;
346
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 v->rangelow = FREQ_MIN*FREQ_MUL;
348 v->rangehigh = FREQ_MAX*FREQ_MUL;
Alan Cox5aff3082006-08-08 15:47:50 -0300349 v->rxsubchans =V4L2_TUNER_SUB_MONO|V4L2_TUNER_SUB_STEREO;
350 v->capability=V4L2_TUNER_CAP_LOW;
351 if(radio->stereo)
352 v->audmode = V4L2_TUNER_MODE_STEREO;
353 else
354 v->audmode = V4L2_TUNER_MODE_MONO;
355 v->signal = 0xFFFF; /* We can't get the signal strength */
356
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357 return 0;
358 }
Alan Cox5aff3082006-08-08 15:47:50 -0300359 case VIDIOC_S_TUNER:
360 {
361 struct v4l2_tuner *v = arg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362
Alan Cox5aff3082006-08-08 15:47:50 -0300363 if (v->index > 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364 return -EINVAL;
Alan Cox5aff3082006-08-08 15:47:50 -0300365
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 return 0;
367 }
Alan Cox5aff3082006-08-08 15:47:50 -0300368 case VIDIOC_S_FREQUENCY:
369 {
370 struct v4l2_frequency *f = arg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371
Alan Cox5aff3082006-08-08 15:47:50 -0300372 radio->curfreq = f->frequency;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 if (dsbr100_setfreq(radio, radio->curfreq)==-1)
374 warn("Set frequency failed");
375 return 0;
376 }
Alan Cox5aff3082006-08-08 15:47:50 -0300377 case VIDIOC_G_FREQUENCY:
378 {
379 struct v4l2_frequency *f = arg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380
Alan Cox5aff3082006-08-08 15:47:50 -0300381 f->type = V4L2_TUNER_RADIO;
382 f->frequency = radio->curfreq;
383
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300384 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385 }
Alan Cox5aff3082006-08-08 15:47:50 -0300386 case VIDIOC_QUERYCTRL:
387 {
388 struct v4l2_queryctrl *qc = arg;
389 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390
Alan Cox5aff3082006-08-08 15:47:50 -0300391 for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
392 if (qc->id && qc->id == radio_qctrl[i].id) {
393 memcpy(qc, &(radio_qctrl[i]),
394 sizeof(*qc));
395 return 0;
396 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397 }
Alan Cox5aff3082006-08-08 15:47:50 -0300398 return -EINVAL;
399 }
400 case VIDIOC_G_CTRL:
401 {
402 struct v4l2_control *ctrl= arg;
403
404 switch (ctrl->id) {
405 case V4L2_CID_AUDIO_MUTE:
406 ctrl->value=radio->muted;
407 return 0;
408 }
409 return -EINVAL;
410 }
411 case VIDIOC_S_CTRL:
412 {
413 struct v4l2_control *ctrl= arg;
414
415 switch (ctrl->id) {
416 case V4L2_CID_AUDIO_MUTE:
417 if (ctrl->value) {
418 if (dsbr100_stop(radio)==-1)
419 warn("Radio did not respond properly");
420 } else {
421 if (dsbr100_start(radio)==-1)
422 warn("Radio did not respond properly");
423 }
424 return 0;
425 }
426 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427 }
428 default:
Alan Cox5aff3082006-08-08 15:47:50 -0300429 return v4l_compat_translate_ioctl(inode,file,cmd,arg,
430 usb_dsbr100_do_ioctl);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 }
432}
433
434static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
435 unsigned int cmd, unsigned long arg)
436{
437 return video_usercopy(inode, file, cmd, arg, usb_dsbr100_do_ioctl);
438}
439
440static int usb_dsbr100_open(struct inode *inode, struct file *file)
441{
Alan Cox5aff3082006-08-08 15:47:50 -0300442 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443
444 radio->users = 1;
Alan Cox5aff3082006-08-08 15:47:50 -0300445 radio->muted = 1;
446
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447 if (dsbr100_start(radio)<0) {
448 warn("Radio did not start up properly");
449 radio->users = 0;
450 return -EIO;
451 }
452 dsbr100_setfreq(radio, radio->curfreq);
453 return 0;
454}
455
456static int usb_dsbr100_close(struct inode *inode, struct file *file)
457{
Alan Cox5aff3082006-08-08 15:47:50 -0300458 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459
460 if (!radio)
461 return -ENODEV;
462 radio->users = 0;
463 if (radio->removed) {
464 kfree(radio);
465 }
466 return 0;
467}
468
469static int __init dsbr100_init(void)
470{
471 int retval = usb_register(&usb_dsbr100_driver);
472 info(DRIVER_VERSION ":" DRIVER_DESC);
473 return retval;
474}
475
476static void __exit dsbr100_exit(void)
477{
478 usb_deregister(&usb_dsbr100_driver);
479}
480
481module_init (dsbr100_init);
482module_exit (dsbr100_exit);
483
484MODULE_AUTHOR( DRIVER_AUTHOR );
485MODULE_DESCRIPTION( DRIVER_DESC );
486MODULE_LICENSE("GPL");