2 * USB PhidgetInterfaceKit driver 1.0
4 * Copyright (C) 2004, 2006 Sean Young <sean@mess.org>
5 * Copyright (C) 2005 Daniel Saakes <daniel@saakes.net>
6 * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This is a driver for the USB PhidgetInterfaceKit.
16 #include <linux/kernel.h>
17 #include <linux/errno.h>
18 #include <linux/init.h>
19 #include <linux/slab.h>
20 #include <linux/module.h>
21 #include <linux/usb.h>
25 #define DRIVER_AUTHOR "Sean Young <sean@mess.org>"
26 #define DRIVER_DESC "USB PhidgetInterfaceKit Driver"
28 #define USB_VENDOR_ID_GLAB 0x06c2
29 #define USB_DEVICE_ID_INTERFACEKIT004 0x0040
30 #define USB_DEVICE_ID_INTERFACEKIT01616 0x0044
31 #define USB_DEVICE_ID_INTERFACEKIT888 0x0045
32 #define USB_DEVICE_ID_INTERFACEKIT047 0x0051
33 #define USB_DEVICE_ID_INTERFACEKIT088 0x0053
35 #define USB_VENDOR_ID_WISEGROUP 0x0925
36 #define USB_DEVICE_ID_INTERFACEKIT884 0x8201
38 #define MAX_INTERFACES 16
40 #define URB_INT_SIZE 8
42 struct driver_interfacekit
{
48 #define ifkit(_sensors, _inputs, _outputs, _lcd) \
49 static struct driver_interfacekit ph_##_sensors##_inputs##_outputs = { \
50 .sensors = _sensors, \
52 .outputs = _outputs, \
62 static unsigned long device_no
;
65 struct usb_device
*udev
;
66 struct usb_interface
*intf
;
67 struct driver_interfacekit
*ifkit
;
69 unsigned long outputs
;
71 u8 inputs
[MAX_INTERFACES
];
72 u16 sensors
[MAX_INTERFACES
];
79 struct work_struct do_notify
;
80 unsigned long input_events
;
81 unsigned long sensor_events
;
84 static struct usb_device_id id_table
[] = {
85 {USB_DEVICE(USB_VENDOR_ID_GLAB
, USB_DEVICE_ID_INTERFACEKIT004
),
86 .driver_info
= (kernel_ulong_t
)&ph_004
},
87 {USB_DEVICE(USB_VENDOR_ID_GLAB
, USB_DEVICE_ID_INTERFACEKIT888
),
88 .driver_info
= (kernel_ulong_t
)&ph_888
},
89 {USB_DEVICE(USB_VENDOR_ID_GLAB
, USB_DEVICE_ID_INTERFACEKIT047
),
90 .driver_info
= (kernel_ulong_t
)&ph_047
},
91 {USB_DEVICE(USB_VENDOR_ID_GLAB
, USB_DEVICE_ID_INTERFACEKIT088
),
92 .driver_info
= (kernel_ulong_t
)&ph_088
},
93 {USB_DEVICE(USB_VENDOR_ID_GLAB
, USB_DEVICE_ID_INTERFACEKIT01616
),
94 .driver_info
= (kernel_ulong_t
)&ph_01616
},
95 {USB_DEVICE(USB_VENDOR_ID_WISEGROUP
, USB_DEVICE_ID_INTERFACEKIT884
),
96 .driver_info
= (kernel_ulong_t
)&ph_884
},
99 MODULE_DEVICE_TABLE(usb
, id_table
);
101 static int change_outputs(struct interfacekit
*kit
, int output_num
, int enable
)
107 set_bit(output_num
, &kit
->outputs
);
109 clear_bit(output_num
, &kit
->outputs
);
111 buffer
= kzalloc(4, GFP_KERNEL
);
113 dev_err(&kit
->udev
->dev
, "%s - out of memory\n", __FUNCTION__
);
116 buffer
[0] = (u8
)kit
->outputs
;
117 buffer
[1] = (u8
)(kit
->outputs
>> 8);
119 dev_dbg(&kit
->udev
->dev
, "sending data: 0x%04x\n", (u16
)kit
->outputs
);
121 retval
= usb_control_msg(kit
->udev
,
122 usb_sndctrlpipe(kit
->udev
, 0),
123 0x09, 0x21, 0x0200, 0x0000, buffer
, 4, 2000);
126 dev_err(&kit
->udev
->dev
, "usb_control_msg returned %d\n",
130 return retval
< 0 ? retval
: 0;
133 static int change_string(struct interfacekit
*kit
, const char *display
, unsigned char row
)
135 unsigned char *buffer
;
136 unsigned char *form_buffer
;
137 int retval
= -ENOMEM
;
138 int i
,j
, len
, buf_ptr
;
140 buffer
= kmalloc(8, GFP_KERNEL
);
141 form_buffer
= kmalloc(30, GFP_KERNEL
);
142 if ((!buffer
) || (!form_buffer
)) {
143 dev_err(&kit
->udev
->dev
, "%s - out of memory\n", __FUNCTION__
);
147 len
= strlen(display
);
151 dev_dbg(&kit
->udev
->dev
, "Setting LCD line %d to %s\n", row
, display
);
153 form_buffer
[0] = row
* 0x40 + 0x80;
154 form_buffer
[1] = 0x02;
156 for (i
= 0; i
<len
; i
++)
157 form_buffer
[buf_ptr
++] = display
[i
];
159 for (i
= 0; i
< (20 - len
); i
++)
160 form_buffer
[buf_ptr
++] = 0x20;
161 form_buffer
[buf_ptr
++] = 0x01;
162 form_buffer
[buf_ptr
++] = row
* 0x40 + 0x80 + strlen(display
);
164 for (i
= 0; i
< buf_ptr
; i
+= 7) {
165 if ((buf_ptr
- i
) > 7)
169 for (j
= 0; j
< len
; j
++)
170 buffer
[j
] = form_buffer
[i
+ j
];
173 retval
= usb_control_msg(kit
->udev
,
174 usb_sndctrlpipe(kit
->udev
, 0),
175 0x09, 0x21, 0x0200, 0x0000, buffer
, 8, 2000);
188 #define set_lcd_line(number) \
189 static ssize_t lcd_line_##number(struct device *dev, \
190 struct device_attribute *attr, \
191 const char *buf, size_t count) \
193 struct interfacekit *kit = dev_get_drvdata(dev); \
194 change_string(kit, buf, number - 1); \
197 static DEVICE_ATTR(lcd_line_##number, S_IWUGO, NULL, lcd_line_##number);
201 static ssize_t
set_backlight(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
203 struct interfacekit
*kit
= dev_get_drvdata(dev
);
205 unsigned char *buffer
;
206 int retval
= -ENOMEM
;
208 buffer
= kzalloc(8, GFP_KERNEL
);
210 dev_err(&kit
->udev
->dev
, "%s - out of memory\n", __FUNCTION__
);
214 if (sscanf(buf
, "%d", &enabled
) < 1) {
222 dev_dbg(&kit
->udev
->dev
, "Setting backlight to %s\n", enabled
? "on" : "off");
224 retval
= usb_control_msg(kit
->udev
,
225 usb_sndctrlpipe(kit
->udev
, 0),
226 0x09, 0x21, 0x0200, 0x0000, buffer
, 8, 2000);
235 static DEVICE_ATTR(backlight
, S_IWUGO
, NULL
, set_backlight
);
237 static void remove_lcd_files(struct interfacekit
*kit
)
239 if (kit
->lcd_files_on
) {
240 dev_dbg(&kit
->udev
->dev
, "Removing lcd files\n");
241 device_remove_file(kit
->dev
, &dev_attr_lcd_line_1
);
242 device_remove_file(kit
->dev
, &dev_attr_lcd_line_2
);
243 device_remove_file(kit
->dev
, &dev_attr_backlight
);
247 static ssize_t
enable_lcd_files(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
249 struct interfacekit
*kit
= dev_get_drvdata(dev
);
252 if (kit
->ifkit
->has_lcd
== 0)
255 if (sscanf(buf
, "%d", &enable
) < 1)
259 if (!kit
->lcd_files_on
) {
260 dev_dbg(&kit
->udev
->dev
, "Adding lcd files\n");
261 device_create_file(kit
->dev
, &dev_attr_lcd_line_1
);
262 device_create_file(kit
->dev
, &dev_attr_lcd_line_2
);
263 device_create_file(kit
->dev
, &dev_attr_backlight
);
264 kit
->lcd_files_on
= 1;
267 if (kit
->lcd_files_on
) {
268 remove_lcd_files(kit
);
269 kit
->lcd_files_on
= 0;
275 static DEVICE_ATTR(lcd
, S_IWUGO
, NULL
, enable_lcd_files
);
277 static void interfacekit_irq(struct urb
*urb
, struct pt_regs
*regs
)
279 struct interfacekit
*kit
= urb
->context
;
280 unsigned char *buffer
= kit
->data
;
281 int i
, level
, sensor
;
284 switch (urb
->status
) {
285 case 0: /* success */
287 case -ECONNRESET
: /* unlink */
291 /* -EPIPE: should clear the halt */
297 if (kit
->ifkit
->inputs
== 16) {
298 for (i
=0; i
< 8; i
++) {
299 level
= (buffer
[0] >> i
) & 1;
300 if (kit
->inputs
[i
] != level
) {
301 kit
->inputs
[i
] = level
;
302 set_bit(i
, &kit
->input_events
);
304 level
= (buffer
[1] >> i
) & 1;
305 if (kit
->inputs
[8 + i
] != level
) {
306 kit
->inputs
[8 + i
] = level
;
307 set_bit(8 + i
, &kit
->input_events
);
311 else if (kit
->ifkit
->inputs
== 8) {
312 for (i
=0; i
< 8; i
++) {
313 level
= (buffer
[1] >> i
) & 1;
314 if (kit
->inputs
[i
] != level
) {
315 kit
->inputs
[i
] = level
;
316 set_bit(i
, &kit
->input_events
);
322 if (kit
->ifkit
->sensors
) {
323 sensor
= (buffer
[0] & 1) ? 4 : 0;
325 level
= buffer
[2] + (buffer
[3] & 0x0f) * 256;
326 if (level
!= kit
->sensors
[sensor
]) {
327 kit
->sensors
[sensor
] = level
;
328 set_bit(sensor
, &kit
->sensor_events
);
331 level
= buffer
[4] + (buffer
[3] & 0xf0) * 16;
332 if (level
!= kit
->sensors
[sensor
]) {
333 kit
->sensors
[sensor
] = level
;
334 set_bit(sensor
, &kit
->sensor_events
);
337 level
= buffer
[5] + (buffer
[6] & 0x0f) * 256;
338 if (level
!= kit
->sensors
[sensor
]) {
339 kit
->sensors
[sensor
] = level
;
340 set_bit(sensor
, &kit
->sensor_events
);
343 level
= buffer
[7] + (buffer
[6] & 0xf0) * 16;
344 if (level
!= kit
->sensors
[sensor
]) {
345 kit
->sensors
[sensor
] = level
;
346 set_bit(sensor
, &kit
->sensor_events
);
350 if (kit
->input_events
|| kit
->sensor_events
)
351 schedule_work(&kit
->do_notify
);
354 status
= usb_submit_urb(urb
, SLAB_ATOMIC
);
356 err("can't resubmit intr, %s-%s/interfacekit0, status %d",
357 kit
->udev
->bus
->bus_name
,
358 kit
->udev
->devpath
, status
);
361 static void do_notify(void *data
)
363 struct interfacekit
*kit
= data
;
367 for (i
=0; i
<kit
->ifkit
->inputs
; i
++) {
368 if (test_and_clear_bit(i
, &kit
->input_events
)) {
369 sprintf(sysfs_file
, "input%d", i
+ 1);
370 sysfs_notify(&kit
->dev
->kobj
, NULL
, sysfs_file
);
374 for (i
=0; i
<kit
->ifkit
->sensors
; i
++) {
375 if (test_and_clear_bit(i
, &kit
->sensor_events
)) {
376 sprintf(sysfs_file
, "sensor%d", i
+ 1);
377 sysfs_notify(&kit
->dev
->kobj
, NULL
, sysfs_file
);
382 #define show_set_output(value) \
383 static ssize_t set_output##value(struct device *dev, \
384 struct device_attribute *attr, \
385 const char *buf, size_t count) \
387 struct interfacekit *kit = dev_get_drvdata(dev); \
391 if (sscanf(buf, "%d", &enabled) < 1) \
394 retval = change_outputs(kit, value - 1, enabled); \
396 return retval ? retval : count; \
399 static ssize_t show_output##value(struct device *dev, \
400 struct device_attribute *attr, \
403 struct interfacekit *kit = dev_get_drvdata(dev); \
405 return sprintf(buf, "%d\n", !!test_bit(value - 1, &kit->outputs));\
407 static DEVICE_ATTR(output##value, S_IWUGO | S_IRUGO, \
408 show_output##value, set_output##value);
426 #define show_input(value) \
427 static ssize_t show_input##value(struct device *dev, struct device_attribute *attr, char *buf) \
429 struct interfacekit *kit = dev_get_drvdata(dev); \
431 return sprintf(buf, "%d\n", (int)kit->inputs[value - 1]); \
433 static DEVICE_ATTR(input##value, S_IRUGO, show_input##value, NULL);
452 #define show_sensor(value) \
453 static ssize_t show_sensor##value(struct device *dev, \
454 struct device_attribute *attr, \
457 struct interfacekit *kit = dev_get_drvdata(dev); \
459 return sprintf(buf, "%d\n", (int)kit->sensors[value - 1]); \
461 static DEVICE_ATTR(sensor##value, S_IRUGO, show_sensor##value, NULL);
472 static int interfacekit_probe(struct usb_interface
*intf
, const struct usb_device_id
*id
)
474 struct usb_device
*dev
= interface_to_usbdev(intf
);
475 struct usb_host_interface
*interface
;
476 struct usb_endpoint_descriptor
*endpoint
;
477 struct interfacekit
*kit
;
478 struct driver_interfacekit
*ifkit
;
479 int pipe
, maxp
, rc
= -ENOMEM
;
482 ifkit
= (struct driver_interfacekit
*)id
->driver_info
;
486 interface
= intf
->cur_altsetting
;
487 if (interface
->desc
.bNumEndpoints
!= 1)
490 endpoint
= &interface
->endpoint
[0].desc
;
491 if (!(endpoint
->bEndpointAddress
& 0x80))
496 pipe
= usb_rcvintpipe(dev
, endpoint
->bEndpointAddress
);
497 maxp
= usb_maxpacket(dev
, pipe
, usb_pipeout(pipe
));
499 kit
= kzalloc(sizeof(*kit
), GFP_KERNEL
);
505 kit
->data
= usb_buffer_alloc(dev
, URB_INT_SIZE
, SLAB_ATOMIC
, &kit
->data_dma
);
509 kit
->irq
= usb_alloc_urb(0, GFP_KERNEL
);
513 kit
->udev
= usb_get_dev(dev
);
515 INIT_WORK(&kit
->do_notify
, do_notify
, kit
);
516 usb_fill_int_urb(kit
->irq
, kit
->udev
, pipe
, kit
->data
,
517 maxp
> URB_INT_SIZE
? URB_INT_SIZE
: maxp
,
518 interfacekit_irq
, kit
, endpoint
->bInterval
);
519 kit
->irq
->transfer_dma
= kit
->data_dma
;
520 kit
->irq
->transfer_flags
|= URB_NO_TRANSFER_DMA_MAP
;
522 usb_set_intfdata(intf
, kit
);
525 bit
= find_first_zero_bit(&device_no
, sizeof(device_no
));
526 value
= test_and_set_bit(bit
, &device_no
);
530 kit
->dev
= device_create(phidget_class
, &kit
->udev
->dev
, 0,
531 "interfacekit%d", kit
->dev_no
);
532 if (IS_ERR(kit
->dev
)) {
533 rc
= PTR_ERR(kit
->dev
);
537 dev_set_drvdata(kit
->dev
, kit
);
539 if (usb_submit_urb(kit
->irq
, GFP_KERNEL
)) {
544 if (ifkit
->outputs
>= 4) {
545 device_create_file(kit
->dev
, &dev_attr_output1
);
546 device_create_file(kit
->dev
, &dev_attr_output2
);
547 device_create_file(kit
->dev
, &dev_attr_output3
);
548 device_create_file(kit
->dev
, &dev_attr_output4
);
550 if (ifkit
->outputs
>= 8) {
551 device_create_file(kit
->dev
, &dev_attr_output5
);
552 device_create_file(kit
->dev
, &dev_attr_output6
);
553 device_create_file(kit
->dev
, &dev_attr_output7
);
554 device_create_file(kit
->dev
, &dev_attr_output8
);
556 if (ifkit
->outputs
== 16) {
557 device_create_file(kit
->dev
, &dev_attr_output9
);
558 device_create_file(kit
->dev
, &dev_attr_output10
);
559 device_create_file(kit
->dev
, &dev_attr_output11
);
560 device_create_file(kit
->dev
, &dev_attr_output12
);
561 device_create_file(kit
->dev
, &dev_attr_output13
);
562 device_create_file(kit
->dev
, &dev_attr_output14
);
563 device_create_file(kit
->dev
, &dev_attr_output15
);
564 device_create_file(kit
->dev
, &dev_attr_output16
);
567 if (ifkit
->inputs
>= 4) {
568 device_create_file(kit
->dev
, &dev_attr_input1
);
569 device_create_file(kit
->dev
, &dev_attr_input2
);
570 device_create_file(kit
->dev
, &dev_attr_input3
);
571 device_create_file(kit
->dev
, &dev_attr_input4
);
573 if (ifkit
->inputs
>= 8) {
574 device_create_file(kit
->dev
, &dev_attr_input5
);
575 device_create_file(kit
->dev
, &dev_attr_input6
);
576 device_create_file(kit
->dev
, &dev_attr_input7
);
577 device_create_file(kit
->dev
, &dev_attr_input8
);
579 if (ifkit
->inputs
== 16) {
580 device_create_file(kit
->dev
, &dev_attr_input9
);
581 device_create_file(kit
->dev
, &dev_attr_input10
);
582 device_create_file(kit
->dev
, &dev_attr_input11
);
583 device_create_file(kit
->dev
, &dev_attr_input12
);
584 device_create_file(kit
->dev
, &dev_attr_input13
);
585 device_create_file(kit
->dev
, &dev_attr_input14
);
586 device_create_file(kit
->dev
, &dev_attr_input15
);
587 device_create_file(kit
->dev
, &dev_attr_input16
);
590 if (ifkit
->sensors
>= 4) {
591 device_create_file(kit
->dev
, &dev_attr_sensor1
);
592 device_create_file(kit
->dev
, &dev_attr_sensor2
);
593 device_create_file(kit
->dev
, &dev_attr_sensor3
);
594 device_create_file(kit
->dev
, &dev_attr_sensor4
);
596 if (ifkit
->sensors
>= 7) {
597 device_create_file(kit
->dev
, &dev_attr_sensor5
);
598 device_create_file(kit
->dev
, &dev_attr_sensor6
);
599 device_create_file(kit
->dev
, &dev_attr_sensor7
);
601 if (ifkit
->sensors
== 8)
602 device_create_file(kit
->dev
, &dev_attr_sensor8
);
605 device_create_file(kit
->dev
, &dev_attr_lcd
);
607 dev_info(&intf
->dev
, "USB PhidgetInterfaceKit %d/%d/%d attached\n",
608 ifkit
->sensors
, ifkit
->inputs
, ifkit
->outputs
);
615 usb_free_urb(kit
->irq
);
617 usb_buffer_free(dev
, URB_INT_SIZE
, kit
->data
, kit
->data_dma
);
619 device_unregister(kit
->dev
);
620 if (kit
->dev_no
>= 0)
621 clear_bit(kit
->dev_no
, &device_no
);
629 static void interfacekit_disconnect(struct usb_interface
*interface
)
631 struct interfacekit
*kit
;
633 kit
= usb_get_intfdata(interface
);
634 usb_set_intfdata(interface
, NULL
);
638 usb_kill_urb(kit
->irq
);
639 usb_free_urb(kit
->irq
);
640 usb_buffer_free(kit
->udev
, URB_INT_SIZE
, kit
->data
, kit
->data_dma
);
642 cancel_delayed_work(&kit
->do_notify
);
644 if (kit
->ifkit
->outputs
>= 4) {
645 device_remove_file(kit
->dev
, &dev_attr_output1
);
646 device_remove_file(kit
->dev
, &dev_attr_output2
);
647 device_remove_file(kit
->dev
, &dev_attr_output3
);
648 device_remove_file(kit
->dev
, &dev_attr_output4
);
650 if (kit
->ifkit
->outputs
>= 8) {
651 device_remove_file(kit
->dev
, &dev_attr_output5
);
652 device_remove_file(kit
->dev
, &dev_attr_output6
);
653 device_remove_file(kit
->dev
, &dev_attr_output7
);
654 device_remove_file(kit
->dev
, &dev_attr_output8
);
656 if (kit
->ifkit
->outputs
== 16) {
657 device_remove_file(kit
->dev
, &dev_attr_output9
);
658 device_remove_file(kit
->dev
, &dev_attr_output10
);
659 device_remove_file(kit
->dev
, &dev_attr_output11
);
660 device_remove_file(kit
->dev
, &dev_attr_output12
);
661 device_remove_file(kit
->dev
, &dev_attr_output13
);
662 device_remove_file(kit
->dev
, &dev_attr_output14
);
663 device_remove_file(kit
->dev
, &dev_attr_output15
);
664 device_remove_file(kit
->dev
, &dev_attr_output16
);
667 if (kit
->ifkit
->inputs
>= 4) {
668 device_remove_file(kit
->dev
, &dev_attr_input1
);
669 device_remove_file(kit
->dev
, &dev_attr_input2
);
670 device_remove_file(kit
->dev
, &dev_attr_input3
);
671 device_remove_file(kit
->dev
, &dev_attr_input4
);
673 if (kit
->ifkit
->inputs
>= 8) {
674 device_remove_file(kit
->dev
, &dev_attr_input5
);
675 device_remove_file(kit
->dev
, &dev_attr_input6
);
676 device_remove_file(kit
->dev
, &dev_attr_input7
);
677 device_remove_file(kit
->dev
, &dev_attr_input8
);
679 if (kit
->ifkit
->inputs
== 16) {
680 device_remove_file(kit
->dev
, &dev_attr_input9
);
681 device_remove_file(kit
->dev
, &dev_attr_input10
);
682 device_remove_file(kit
->dev
, &dev_attr_input11
);
683 device_remove_file(kit
->dev
, &dev_attr_input12
);
684 device_remove_file(kit
->dev
, &dev_attr_input13
);
685 device_remove_file(kit
->dev
, &dev_attr_input14
);
686 device_remove_file(kit
->dev
, &dev_attr_input15
);
687 device_remove_file(kit
->dev
, &dev_attr_input16
);
690 if (kit
->ifkit
->sensors
>= 4) {
691 device_remove_file(kit
->dev
, &dev_attr_sensor1
);
692 device_remove_file(kit
->dev
, &dev_attr_sensor2
);
693 device_remove_file(kit
->dev
, &dev_attr_sensor3
);
694 device_remove_file(kit
->dev
, &dev_attr_sensor4
);
696 if (kit
->ifkit
->sensors
>= 7) {
697 device_remove_file(kit
->dev
, &dev_attr_sensor5
);
698 device_remove_file(kit
->dev
, &dev_attr_sensor6
);
699 device_remove_file(kit
->dev
, &dev_attr_sensor7
);
701 if (kit
->ifkit
->sensors
== 8)
702 device_remove_file(kit
->dev
, &dev_attr_sensor8
);
704 if (kit
->ifkit
->has_lcd
)
705 device_remove_file(kit
->dev
, &dev_attr_lcd
);
707 device_unregister(kit
->dev
);
709 dev_info(&interface
->dev
, "USB PhidgetInterfaceKit %d/%d/%d detached\n",
710 kit
->ifkit
->sensors
, kit
->ifkit
->inputs
, kit
->ifkit
->outputs
);
712 usb_put_dev(kit
->udev
);
713 clear_bit(kit
->dev_no
, &device_no
);
718 static struct usb_driver interfacekit_driver
= {
719 .name
= "phidgetkit",
720 .probe
= interfacekit_probe
,
721 .disconnect
= interfacekit_disconnect
,
725 static int __init
interfacekit_init(void)
729 retval
= usb_register(&interfacekit_driver
);
731 err("usb_register failed. Error number %d", retval
);
736 static void __exit
interfacekit_exit(void)
738 usb_deregister(&interfacekit_driver
);
741 module_init(interfacekit_init
);
742 module_exit(interfacekit_exit
);
744 MODULE_AUTHOR(DRIVER_AUTHOR
);
745 MODULE_DESCRIPTION(DRIVER_DESC
);
746 MODULE_LICENSE("GPL");