2 * lirc_sasem.c - USB remote support for LIRC
5 * Copyright (C) 2004-2005 Oliver Stabel <oliver.stabel@gmx.de>
6 * Tim Davies <tim@opensystems.net.au>
8 * This driver was derived from:
9 * Venky Raju <dev@venky.ws>
10 * "lirc_imon - "LIRC/VFD driver for Ahanix/Soundgraph IMON IR/VFD"
11 * Paul Miller <pmiller9@users.sourceforge.net>'s 2003-2004
12 * "lirc_atiusb - USB remote support for LIRC"
13 * Culver Consulting Services <henry@culcon.com>'s 2003
14 * "Sasem OnAir VFD/IR USB driver"
17 * NOTE - The LCDproc iMon driver should work with this module. More info at
18 * http://www.frogstorm.info/sasem
22 * This program is free software; you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation; either version 2 of the License, or
25 * (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 #include <linux/errno.h>
38 #include <linux/init.h>
39 #include <linux/kernel.h>
40 #include <linux/module.h>
41 #include <linux/slab.h>
42 #include <linux/uaccess.h>
43 #include <linux/usb.h>
45 #include <media/lirc.h>
46 #include <media/lirc_dev.h>
49 #define MOD_AUTHOR "Oliver Stabel <oliver.stabel@gmx.de>, " \
50 "Tim Davies <tim@opensystems.net.au>"
51 #define MOD_DESC "USB Driver for Sasem Remote Controller V1.1"
52 #define MOD_NAME "lirc_sasem"
53 #define MOD_VERSION "0.5"
55 #define VFD_MINOR_BASE 144 /* Same as LCD */
56 #define DEVICE_NAME "lcd%d"
58 #define BUF_CHUNK_SIZE 8
61 #define IOCTL_LCD_CONTRAST 1
63 /*** P R O T O T Y P E S ***/
65 /* USB Callback prototypes */
66 static int sasem_probe(struct usb_interface
*interface
,
67 const struct usb_device_id
*id
);
68 static void sasem_disconnect(struct usb_interface
*interface
);
69 static void usb_rx_callback(struct urb
*urb
);
70 static void usb_tx_callback(struct urb
*urb
);
72 /* VFD file_operations function prototypes */
73 static int vfd_open(struct inode
*inode
, struct file
*file
);
74 static long vfd_ioctl(struct file
*file
, unsigned cmd
, unsigned long arg
);
75 static int vfd_close(struct inode
*inode
, struct file
*file
);
76 static ssize_t
vfd_write(struct file
*file
, const char *buf
,
77 size_t n_bytes
, loff_t
*pos
);
79 /* LIRC driver function prototypes */
80 static int ir_open(void *data
);
81 static void ir_close(void *data
);
83 /* Driver init/exit prototypes */
84 static int __init
sasem_init(void);
85 static void __exit
sasem_exit(void);
87 /*** G L O B A L S ***/
88 #define SASEM_DATA_BUF_SZ 32
90 struct sasem_context
{
92 struct usb_device
*dev
;
93 int vfd_isopen
; /* VFD port has been opened */
94 unsigned int vfd_contrast
; /* VFD contrast */
95 int ir_isopen
; /* IR port has been opened */
96 int dev_present
; /* USB device presence */
97 struct mutex ctx_lock
; /* to lock this object */
98 wait_queue_head_t remove_ok
; /* For unexpected USB disconnects */
100 struct lirc_driver
*driver
;
101 struct usb_endpoint_descriptor
*rx_endpoint
;
102 struct usb_endpoint_descriptor
*tx_endpoint
;
105 unsigned char usb_rx_buf
[8];
106 unsigned char usb_tx_buf
[8];
109 unsigned char data_buf
[SASEM_DATA_BUF_SZ
]; /* user data buffer */
110 struct completion finished
; /* wait for write to finish */
111 atomic_t busy
; /* write in progress */
112 int status
; /* status of tx completion */
115 /* for dealing with repeat codes (wish there was a toggle bit!) */
116 struct timeval presstime
;
121 /* VFD file operations */
122 static const struct file_operations vfd_fops
= {
123 .owner
= THIS_MODULE
,
126 .unlocked_ioctl
= &vfd_ioctl
,
127 .release
= &vfd_close
,
128 .llseek
= noop_llseek
,
131 /* USB Device ID for Sasem USB Control Board */
132 static struct usb_device_id sasem_usb_id_table
[] = {
133 /* Sasem USB Control Board */
134 { USB_DEVICE(0x11ba, 0x0101) },
135 /* Terminating entry */
139 /* USB Device data */
140 static struct usb_driver sasem_driver
= {
142 .probe
= sasem_probe
,
143 .disconnect
= sasem_disconnect
,
144 .id_table
= sasem_usb_id_table
,
147 static struct usb_class_driver sasem_class
= {
150 .minor_base
= VFD_MINOR_BASE
,
153 /* to prevent races between open() and disconnect() */
154 static DEFINE_MUTEX(disconnect_lock
);
159 /*** M O D U L E C O D E ***/
161 MODULE_AUTHOR(MOD_AUTHOR
);
162 MODULE_DESCRIPTION(MOD_DESC
);
163 MODULE_LICENSE("GPL");
164 module_param(debug
, int, S_IRUGO
| S_IWUSR
);
165 MODULE_PARM_DESC(debug
, "Debug messages: 0=no, 1=yes (default: no)");
167 static void delete_context(struct sasem_context
*context
)
169 usb_free_urb(context
->tx_urb
); /* VFD */
170 usb_free_urb(context
->rx_urb
); /* IR */
171 lirc_buffer_free(context
->driver
->rbuf
);
172 kfree(context
->driver
->rbuf
);
173 kfree(context
->driver
);
177 printk(KERN_INFO
"%s: context deleted\n", __func__
);
180 static void deregister_from_lirc(struct sasem_context
*context
)
183 int minor
= context
->driver
->minor
;
185 retval
= lirc_unregister_driver(minor
);
187 err("%s: unable to deregister from lirc (%d)",
190 printk(KERN_INFO
"Deregistered Sasem driver (minor:%d)\n",
196 * Called when the VFD device (e.g. /dev/usb/lcd)
197 * is opened by the application.
199 static int vfd_open(struct inode
*inode
, struct file
*file
)
201 struct usb_interface
*interface
;
202 struct sasem_context
*context
= NULL
;
206 /* prevent races with disconnect */
207 mutex_lock(&disconnect_lock
);
209 subminor
= iminor(inode
);
210 interface
= usb_find_interface(&sasem_driver
, subminor
);
212 err("%s: could not find interface for minor %d",
217 context
= usb_get_intfdata(interface
);
220 err("%s: no context found for minor %d",
226 mutex_lock(&context
->ctx_lock
);
228 if (context
->vfd_isopen
) {
229 err("%s: VFD port is already open", __func__
);
232 context
->vfd_isopen
= 1;
233 file
->private_data
= context
;
234 printk(KERN_INFO
"VFD port opened\n");
237 mutex_unlock(&context
->ctx_lock
);
240 mutex_unlock(&disconnect_lock
);
245 * Called when the VFD device (e.g. /dev/usb/lcd)
246 * is closed by the application.
248 static long vfd_ioctl(struct file
*file
, unsigned cmd
, unsigned long arg
)
250 struct sasem_context
*context
= NULL
;
252 context
= (struct sasem_context
*) file
->private_data
;
255 err("%s: no context for device", __func__
);
259 mutex_lock(&context
->ctx_lock
);
262 case IOCTL_LCD_CONTRAST
:
265 context
->vfd_contrast
= (unsigned int)arg
;
268 printk(KERN_INFO
"Unknown IOCTL command\n");
269 mutex_unlock(&context
->ctx_lock
);
270 return -ENOIOCTLCMD
; /* not supported */
273 mutex_unlock(&context
->ctx_lock
);
278 * Called when the VFD device (e.g. /dev/usb/lcd)
279 * is closed by the application.
281 static int vfd_close(struct inode
*inode
, struct file
*file
)
283 struct sasem_context
*context
= NULL
;
286 context
= (struct sasem_context
*) file
->private_data
;
289 err("%s: no context for device", __func__
);
293 mutex_lock(&context
->ctx_lock
);
295 if (!context
->vfd_isopen
) {
296 err("%s: VFD is not open", __func__
);
299 context
->vfd_isopen
= 0;
300 printk(KERN_INFO
"VFD port closed\n");
301 if (!context
->dev_present
&& !context
->ir_isopen
) {
303 /* Device disconnected before close and IR port is
304 * not open. If IR port is open, context will be
305 * deleted by ir_close. */
306 mutex_unlock(&context
->ctx_lock
);
307 delete_context(context
);
312 mutex_unlock(&context
->ctx_lock
);
317 * Sends a packet to the VFD.
319 static int send_packet(struct sasem_context
*context
)
325 pipe
= usb_sndintpipe(context
->dev
,
326 context
->tx_endpoint
->bEndpointAddress
);
327 interval
= context
->tx_endpoint
->bInterval
;
329 usb_fill_int_urb(context
->tx_urb
, context
->dev
, pipe
,
330 context
->usb_tx_buf
, sizeof(context
->usb_tx_buf
),
331 usb_tx_callback
, context
, interval
);
333 context
->tx_urb
->actual_length
= 0;
335 init_completion(&context
->tx
.finished
);
336 atomic_set(&(context
->tx
.busy
), 1);
338 retval
= usb_submit_urb(context
->tx_urb
, GFP_KERNEL
);
340 atomic_set(&(context
->tx
.busy
), 0);
341 err("%s: error submitting urb (%d)", __func__
, retval
);
343 /* Wait for transmission to complete (or abort) */
344 mutex_unlock(&context
->ctx_lock
);
345 wait_for_completion(&context
->tx
.finished
);
346 mutex_lock(&context
->ctx_lock
);
348 retval
= context
->tx
.status
;
350 err("%s: packet tx failed (%d)", __func__
, retval
);
357 * Writes data to the VFD. The Sasem VFD is 2x16 characters
358 * and requires data in 9 consecutive USB interrupt packets,
359 * each packet carrying 8 bytes.
361 static ssize_t
vfd_write(struct file
*file
, const char *buf
,
362 size_t n_bytes
, loff_t
*pos
)
366 struct sasem_context
*context
;
367 int *data_buf
= NULL
;
369 context
= (struct sasem_context
*) file
->private_data
;
371 err("%s: no context for device", __func__
);
375 mutex_lock(&context
->ctx_lock
);
377 if (!context
->dev_present
) {
378 err("%s: no Sasem device present", __func__
);
383 if (n_bytes
<= 0 || n_bytes
> SASEM_DATA_BUF_SZ
) {
384 err("%s: invalid payload size", __func__
);
389 data_buf
= memdup_user(buf
, n_bytes
);
390 if (IS_ERR(data_buf
)) {
391 retval
= PTR_ERR(data_buf
);
395 memcpy(context
->tx
.data_buf
, data_buf
, n_bytes
);
397 /* Pad with spaces */
398 for (i
= n_bytes
; i
< SASEM_DATA_BUF_SZ
; ++i
)
399 context
->tx
.data_buf
[i
] = ' ';
401 /* Nine 8 byte packets to be sent */
402 /* NOTE: "\x07\x01\0\0\0\0\0\0" or "\x0c\0\0\0\0\0\0\0"
403 * will clear the VFD */
404 for (i
= 0; i
< 9; i
++) {
407 memcpy(context
->usb_tx_buf
, "\x07\0\0\0\0\0\0\0", 8);
408 context
->usb_tx_buf
[1] = (context
->vfd_contrast
) ?
409 (0x2B - (context
->vfd_contrast
- 1) / 250)
413 memcpy(context
->usb_tx_buf
, "\x09\x01\0\0\0\0\0\0", 8);
416 memcpy(context
->usb_tx_buf
, "\x0b\x01\0\0\0\0\0\0", 8);
419 memcpy(context
->usb_tx_buf
, context
->tx
.data_buf
, 8);
422 memcpy(context
->usb_tx_buf
,
423 context
->tx
.data_buf
+ 8, 8);
426 memcpy(context
->usb_tx_buf
, "\x09\x01\0\0\0\0\0\0", 8);
429 memcpy(context
->usb_tx_buf
, "\x0b\x02\0\0\0\0\0\0", 8);
432 memcpy(context
->usb_tx_buf
,
433 context
->tx
.data_buf
+ 16, 8);
436 memcpy(context
->usb_tx_buf
,
437 context
->tx
.data_buf
+ 24, 8);
440 retval
= send_packet(context
);
443 err("%s: send packet failed for packet #%d",
450 mutex_unlock(&context
->ctx_lock
);
453 return (!retval
) ? n_bytes
: retval
;
457 * Callback function for USB core API: transmit data
459 static void usb_tx_callback(struct urb
*urb
)
461 struct sasem_context
*context
;
465 context
= (struct sasem_context
*) urb
->context
;
469 context
->tx
.status
= urb
->status
;
471 /* notify waiters that write has finished */
472 atomic_set(&context
->tx
.busy
, 0);
473 complete(&context
->tx
.finished
);
479 * Called by lirc_dev when the application opens /dev/lirc
481 static int ir_open(void *data
)
484 struct sasem_context
*context
;
486 /* prevent races with disconnect */
487 mutex_lock(&disconnect_lock
);
489 context
= (struct sasem_context
*) data
;
491 mutex_lock(&context
->ctx_lock
);
493 if (context
->ir_isopen
) {
494 err("%s: IR port is already open", __func__
);
499 usb_fill_int_urb(context
->rx_urb
, context
->dev
,
500 usb_rcvintpipe(context
->dev
,
501 context
->rx_endpoint
->bEndpointAddress
),
502 context
->usb_rx_buf
, sizeof(context
->usb_rx_buf
),
503 usb_rx_callback
, context
, context
->rx_endpoint
->bInterval
);
505 retval
= usb_submit_urb(context
->rx_urb
, GFP_KERNEL
);
508 err("%s: usb_submit_urb failed for ir_open (%d)",
511 context
->ir_isopen
= 1;
512 printk(KERN_INFO
"IR port opened\n");
516 mutex_unlock(&context
->ctx_lock
);
518 mutex_unlock(&disconnect_lock
);
523 * Called by lirc_dev when the application closes /dev/lirc
525 static void ir_close(void *data
)
527 struct sasem_context
*context
;
529 context
= (struct sasem_context
*)data
;
531 err("%s: no context for device", __func__
);
535 mutex_lock(&context
->ctx_lock
);
537 usb_kill_urb(context
->rx_urb
);
538 context
->ir_isopen
= 0;
539 printk(KERN_INFO
"IR port closed\n");
541 if (!context
->dev_present
) {
544 * Device disconnected while IR port was
545 * still open. Driver was not deregistered
546 * at disconnect time, so do it now.
548 deregister_from_lirc(context
);
550 if (!context
->vfd_isopen
) {
552 mutex_unlock(&context
->ctx_lock
);
553 delete_context(context
);
556 /* If VFD port is open, context will be deleted by vfd_close */
559 mutex_unlock(&context
->ctx_lock
);
564 * Process the incoming packet
566 static void incoming_packet(struct sasem_context
*context
,
569 int len
= urb
->actual_length
;
570 unsigned char *buf
= urb
->transfer_buffer
;
576 printk(KERN_WARNING
"%s: invalid incoming packet size (%d)\n",
582 printk(KERN_INFO
"Incoming data: ");
583 for (i
= 0; i
< 8; ++i
)
584 printk(KERN_CONT
"%02x ", buf
[i
]);
585 printk(KERN_CONT
"\n");
589 * Lirc could deal with the repeat code, but we really need to block it
590 * if it arrives too late. Otherwise we could repeat the wrong code.
593 /* get the time since the last button press */
594 do_gettimeofday(&tv
);
595 ms
= (tv
.tv_sec
- context
->presstime
.tv_sec
) * 1000 +
596 (tv
.tv_usec
- context
->presstime
.tv_usec
) / 1000;
598 if (memcmp(buf
, "\x08\0\0\0\0\0\0\0", 8) == 0) {
600 * the repeat code is being sent, so we copy
601 * the old code to LIRC
605 * NOTE: Only if the last code was less than 250ms ago
606 * - no one should be able to push another (undetected) button
607 * in that time and then get a false repeat of the previous
608 * press but it is long enough for a genuine repeat
610 if ((ms
< 250) && (context
->codesaved
!= 0)) {
611 memcpy(buf
, &context
->lastcode
, 8);
612 context
->presstime
.tv_sec
= tv
.tv_sec
;
613 context
->presstime
.tv_usec
= tv
.tv_usec
;
616 /* save the current valid code for repeats */
617 memcpy(&context
->lastcode
, buf
, 8);
619 * set flag to signal a valid code was save;
620 * just for safety reasons
622 context
->codesaved
= 1;
623 context
->presstime
.tv_sec
= tv
.tv_sec
;
624 context
->presstime
.tv_usec
= tv
.tv_usec
;
627 lirc_buffer_write(context
->driver
->rbuf
, buf
);
628 wake_up(&context
->driver
->rbuf
->wait_poll
);
632 * Callback function for USB core API: receive data
634 static void usb_rx_callback(struct urb
*urb
)
636 struct sasem_context
*context
;
640 context
= (struct sasem_context
*) urb
->context
;
644 switch (urb
->status
) {
646 case -ENOENT
: /* usbcore unlink successful! */
650 if (context
->ir_isopen
)
651 incoming_packet(context
, urb
);
655 printk(KERN_WARNING
"%s: status (%d): ignored",
656 __func__
, urb
->status
);
660 usb_submit_urb(context
->rx_urb
, GFP_ATOMIC
);
667 * Callback function for USB core API: Probe
669 static int sasem_probe(struct usb_interface
*interface
,
670 const struct usb_device_id
*id
)
672 struct usb_device
*dev
= NULL
;
673 struct usb_host_interface
*iface_desc
= NULL
;
674 struct usb_endpoint_descriptor
*rx_endpoint
= NULL
;
675 struct usb_endpoint_descriptor
*tx_endpoint
= NULL
;
676 struct urb
*rx_urb
= NULL
;
677 struct urb
*tx_urb
= NULL
;
678 struct lirc_driver
*driver
= NULL
;
679 struct lirc_buffer
*rbuf
= NULL
;
686 struct sasem_context
*context
= NULL
;
689 printk(KERN_INFO
"%s: found Sasem device\n", __func__
);
692 dev
= usb_get_dev(interface_to_usbdev(interface
));
693 iface_desc
= interface
->cur_altsetting
;
694 num_endpoints
= iface_desc
->desc
.bNumEndpoints
;
697 * Scan the endpoint list and set:
698 * first input endpoint = IR endpoint
699 * first output endpoint = VFD endpoint
705 for (i
= 0; i
< num_endpoints
&& !(ir_ep_found
&& vfd_ep_found
); ++i
) {
707 struct usb_endpoint_descriptor
*ep
;
710 ep
= &iface_desc
->endpoint
[i
].desc
;
711 ep_dir
= ep
->bEndpointAddress
& USB_ENDPOINT_DIR_MASK
;
712 ep_type
= ep
->bmAttributes
& USB_ENDPOINT_XFERTYPE_MASK
;
715 ep_dir
== USB_DIR_IN
&&
716 ep_type
== USB_ENDPOINT_XFER_INT
) {
721 printk(KERN_INFO
"%s: found IR endpoint\n",
724 } else if (!vfd_ep_found
&&
725 ep_dir
== USB_DIR_OUT
&&
726 ep_type
== USB_ENDPOINT_XFER_INT
) {
731 printk(KERN_INFO
"%s: found VFD endpoint\n",
736 /* Input endpoint is mandatory */
739 err("%s: no valid input (IR) endpoint found.", __func__
);
745 printk(KERN_INFO
"%s: no valid output (VFD) endpoint found.\n",
749 /* Allocate memory */
752 context
= kzalloc(sizeof(struct sasem_context
), GFP_KERNEL
);
754 err("%s: kzalloc failed for context", __func__
);
756 goto alloc_status_switch
;
758 driver
= kzalloc(sizeof(struct lirc_driver
), GFP_KERNEL
);
760 err("%s: kzalloc failed for lirc_driver", __func__
);
762 goto alloc_status_switch
;
764 rbuf
= kmalloc(sizeof(struct lirc_buffer
), GFP_KERNEL
);
766 err("%s: kmalloc failed for lirc_buffer", __func__
);
768 goto alloc_status_switch
;
770 if (lirc_buffer_init(rbuf
, BUF_CHUNK_SIZE
, BUF_SIZE
)) {
771 err("%s: lirc_buffer_init failed", __func__
);
773 goto alloc_status_switch
;
775 rx_urb
= usb_alloc_urb(0, GFP_KERNEL
);
777 err("%s: usb_alloc_urb failed for IR urb", __func__
);
779 goto alloc_status_switch
;
782 tx_urb
= usb_alloc_urb(0, GFP_KERNEL
);
784 err("%s: usb_alloc_urb failed for VFD urb",
787 goto alloc_status_switch
;
791 mutex_init(&context
->ctx_lock
);
793 strcpy(driver
->name
, MOD_NAME
);
795 driver
->code_length
= 64;
796 driver
->sample_rate
= 0;
797 driver
->features
= LIRC_CAN_REC_LIRCCODE
;
798 driver
->data
= context
;
800 driver
->set_use_inc
= ir_open
;
801 driver
->set_use_dec
= ir_close
;
802 driver
->dev
= &interface
->dev
;
803 driver
->owner
= THIS_MODULE
;
805 mutex_lock(&context
->ctx_lock
);
807 lirc_minor
= lirc_register_driver(driver
);
808 if (lirc_minor
< 0) {
809 err("%s: lirc_register_driver failed", __func__
);
814 printk(KERN_INFO
"%s: Registered Sasem driver (minor:%d)\n",
815 __func__
, lirc_minor
);
819 switch (alloc_status
) {
823 usb_free_urb(tx_urb
);
825 usb_free_urb(rx_urb
);
827 lirc_buffer_free(rbuf
);
840 /* Needed while unregistering! */
841 driver
->minor
= lirc_minor
;
844 context
->dev_present
= 1;
845 context
->rx_endpoint
= rx_endpoint
;
846 context
->rx_urb
= rx_urb
;
848 context
->tx_endpoint
= tx_endpoint
;
849 context
->tx_urb
= tx_urb
;
850 context
->vfd_contrast
= 1000; /* range 0 - 1000 */
852 context
->driver
= driver
;
854 usb_set_intfdata(interface
, context
);
859 printk(KERN_INFO
"Registering VFD with sysfs\n");
860 if (usb_register_dev(interface
, &sasem_class
))
861 /* Not a fatal error, so ignore */
862 printk(KERN_INFO
"%s: could not get a minor number "
863 "for VFD\n", __func__
);
866 printk(KERN_INFO
"%s: Sasem device on usb<%d:%d> initialized\n",
867 __func__
, dev
->bus
->busnum
, dev
->devnum
);
869 mutex_unlock(&context
->ctx_lock
);
875 * Callback function for USB core API: disonnect
877 static void sasem_disconnect(struct usb_interface
*interface
)
879 struct sasem_context
*context
;
881 /* prevent races with ir_open()/vfd_open() */
882 mutex_lock(&disconnect_lock
);
884 context
= usb_get_intfdata(interface
);
885 mutex_lock(&context
->ctx_lock
);
887 printk(KERN_INFO
"%s: Sasem device disconnected\n", __func__
);
889 usb_set_intfdata(interface
, NULL
);
890 context
->dev_present
= 0;
893 usb_kill_urb(context
->rx_urb
);
895 /* Abort ongoing write */
896 if (atomic_read(&context
->tx
.busy
)) {
898 usb_kill_urb(context
->tx_urb
);
899 wait_for_completion(&context
->tx
.finished
);
902 /* De-register from lirc_dev if IR port is not open */
903 if (!context
->ir_isopen
)
904 deregister_from_lirc(context
);
906 usb_deregister_dev(interface
, &sasem_class
);
908 mutex_unlock(&context
->ctx_lock
);
910 if (!context
->ir_isopen
&& !context
->vfd_isopen
)
911 delete_context(context
);
913 mutex_unlock(&disconnect_lock
);
916 static int __init
sasem_init(void)
920 printk(KERN_INFO MOD_DESC
", v" MOD_VERSION
"\n");
921 printk(KERN_INFO MOD_AUTHOR
"\n");
923 rc
= usb_register(&sasem_driver
);
925 err("%s: usb register failed (%d)", __func__
, rc
);
931 static void __exit
sasem_exit(void)
933 usb_deregister(&sasem_driver
);
934 printk(KERN_INFO
"module removed. Goodbye!\n");
938 module_init(sasem_init
);
939 module_exit(sasem_exit
);