1 /*****************************************************************************/
4 * uss720.c -- USS720 USB Parport Cable.
6 * Copyright (C) 1999, 2005, 2010
7 * Thomas Sailer (t.sailer@alumni.ethz.ch)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * Based on parport_pc.c
26 * 0.1 04.08.1999 Created
27 * 0.2 07.08.1999 Some fixes mainly suggested by Tim Waugh
28 * Interrupt handling currently disabled because
29 * usb_request_irq crashes somewhere within ohci.c
30 * for no apparent reason (that is for me, anyway)
31 * ECP currently untested
32 * 0.3 10.08.1999 fixing merge errors
33 * 0.4 13.08.1999 Added Vendor/Product ID of Brad Hard's cable
34 * 0.5 20.09.1999 usb_control_msg wrapper used
35 * Nov01.2000 usb_device_table support by Adam J. Richter
36 * 08.04.2001 Identify version on module load. gb
37 * 0.6 02.09.2005 Fix "scheduling in interrupt" problem by making save/restore
38 * context asynchronous
42 /*****************************************************************************/
44 #include <linux/module.h>
45 #include <linux/socket.h>
46 #include <linux/parport.h>
47 #include <linux/init.h>
48 #include <linux/usb.h>
49 #include <linux/delay.h>
50 #include <linux/completion.h>
51 #include <linux/kref.h>
52 #include <linux/slab.h>
57 #define DRIVER_VERSION "v0.6"
58 #define DRIVER_AUTHOR "Thomas M. Sailer, t.sailer@alumni.ethz.ch"
59 #define DRIVER_DESC "USB Parport Cable driver for Cables using the Lucent Technologies USS720 Chip"
61 /* --------------------------------------------------------------------- */
63 struct parport_uss720_private
{
64 struct usb_device
*usbdev
;
66 struct kref ref_count
;
67 __u8 reg
[7]; /* USB registers */
68 struct list_head asynclist
;
72 struct uss720_async_request
{
73 struct parport_uss720_private
*priv
;
74 struct kref ref_count
;
75 struct list_head asynclist
;
76 struct completion
compl;
78 struct usb_ctrlrequest
*dr
;
82 /* --------------------------------------------------------------------- */
84 static void destroy_priv(struct kref
*kref
)
86 struct parport_uss720_private
*priv
= container_of(kref
, struct parport_uss720_private
, ref_count
);
88 dev_dbg(&priv
->usbdev
->dev
, "destroying priv datastructure\n");
89 usb_put_dev(priv
->usbdev
);
93 static void destroy_async(struct kref
*kref
)
95 struct uss720_async_request
*rq
= container_of(kref
, struct uss720_async_request
, ref_count
);
96 struct parport_uss720_private
*priv
= rq
->priv
;
100 usb_free_urb(rq
->urb
);
102 spin_lock_irqsave(&priv
->asynclock
, flags
);
103 list_del_init(&rq
->asynclist
);
104 spin_unlock_irqrestore(&priv
->asynclock
, flags
);
106 kref_put(&priv
->ref_count
, destroy_priv
);
109 /* --------------------------------------------------------------------- */
111 static void async_complete(struct urb
*urb
)
113 struct uss720_async_request
*rq
;
115 struct parport_uss720_private
*priv
;
116 int status
= urb
->status
;
122 dev_err(&urb
->dev
->dev
, "async_complete: urb error %d\n",
124 } else if (rq
->dr
->bRequest
== 3) {
125 memcpy(priv
->reg
, rq
->reg
, sizeof(priv
->reg
));
127 dev_dbg(&priv
->usbdev
->dev
, "async_complete regs %7ph\n",
130 /* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */
131 if (rq
->reg
[2] & rq
->reg
[1] & 0x10 && pp
)
132 parport_generic_irq(pp
);
134 complete(&rq
->compl);
135 kref_put(&rq
->ref_count
, destroy_async
);
138 static struct uss720_async_request
*submit_async_request(struct parport_uss720_private
*priv
,
139 __u8 request
, __u8 requesttype
, __u16 value
, __u16 index
,
142 struct usb_device
*usbdev
;
143 struct uss720_async_request
*rq
;
149 usbdev
= priv
->usbdev
;
152 rq
= kzalloc(sizeof(struct uss720_async_request
), mem_flags
);
155 kref_init(&rq
->ref_count
);
156 INIT_LIST_HEAD(&rq
->asynclist
);
157 init_completion(&rq
->compl);
158 kref_get(&priv
->ref_count
);
160 rq
->urb
= usb_alloc_urb(0, mem_flags
);
162 kref_put(&rq
->ref_count
, destroy_async
);
165 rq
->dr
= kmalloc(sizeof(*rq
->dr
), mem_flags
);
167 kref_put(&rq
->ref_count
, destroy_async
);
170 rq
->dr
->bRequestType
= requesttype
;
171 rq
->dr
->bRequest
= request
;
172 rq
->dr
->wValue
= cpu_to_le16(value
);
173 rq
->dr
->wIndex
= cpu_to_le16(index
);
174 rq
->dr
->wLength
= cpu_to_le16((request
== 3) ? sizeof(rq
->reg
) : 0);
175 usb_fill_control_urb(rq
->urb
, usbdev
, (requesttype
& 0x80) ? usb_rcvctrlpipe(usbdev
, 0) : usb_sndctrlpipe(usbdev
, 0),
176 (unsigned char *)rq
->dr
,
177 (request
== 3) ? rq
->reg
: NULL
, (request
== 3) ? sizeof(rq
->reg
) : 0, async_complete
, rq
);
178 /* rq->urb->transfer_flags |= URB_ASYNC_UNLINK; */
179 spin_lock_irqsave(&priv
->asynclock
, flags
);
180 list_add_tail(&rq
->asynclist
, &priv
->asynclist
);
181 spin_unlock_irqrestore(&priv
->asynclock
, flags
);
182 kref_get(&rq
->ref_count
);
183 ret
= usb_submit_urb(rq
->urb
, mem_flags
);
186 destroy_async(&rq
->ref_count
);
187 dev_err(&usbdev
->dev
, "submit_async_request submit_urb failed with %d\n", ret
);
191 static unsigned int kill_all_async_requests_priv(struct parport_uss720_private
*priv
)
193 struct uss720_async_request
*rq
;
195 unsigned int ret
= 0;
197 spin_lock_irqsave(&priv
->asynclock
, flags
);
198 list_for_each_entry(rq
, &priv
->asynclist
, asynclist
) {
199 usb_unlink_urb(rq
->urb
);
202 spin_unlock_irqrestore(&priv
->asynclock
, flags
);
206 /* --------------------------------------------------------------------- */
208 static int get_1284_register(struct parport
*pp
, unsigned char reg
, unsigned char *val
, gfp_t mem_flags
)
210 struct parport_uss720_private
*priv
;
211 struct uss720_async_request
*rq
;
212 static const unsigned char regindex
[9] = {
213 4, 0, 1, 5, 5, 0, 2, 3, 6
219 priv
= pp
->private_data
;
220 rq
= submit_async_request(priv
, 3, 0xc0, ((unsigned int)reg
) << 8, 0, mem_flags
);
222 dev_err(&priv
->usbdev
->dev
, "get_1284_register(%u) failed",
227 kref_put(&rq
->ref_count
, destroy_async
);
230 if (wait_for_completion_timeout(&rq
->compl, HZ
)) {
231 ret
= rq
->urb
->status
;
232 *val
= priv
->reg
[(reg
>= 9) ? 0 : regindex
[reg
]];
234 printk(KERN_WARNING
"get_1284_register: "
235 "usb error %d\n", ret
);
236 kref_put(&rq
->ref_count
, destroy_async
);
239 printk(KERN_WARNING
"get_1284_register timeout\n");
240 kill_all_async_requests_priv(priv
);
244 static int set_1284_register(struct parport
*pp
, unsigned char reg
, unsigned char val
, gfp_t mem_flags
)
246 struct parport_uss720_private
*priv
;
247 struct uss720_async_request
*rq
;
251 priv
= pp
->private_data
;
252 rq
= submit_async_request(priv
, 4, 0x40, (((unsigned int)reg
) << 8) | val
, 0, mem_flags
);
254 dev_err(&priv
->usbdev
->dev
, "set_1284_register(%u,%u) failed",
255 (unsigned int)reg
, (unsigned int)val
);
258 kref_put(&rq
->ref_count
, destroy_async
);
262 /* --------------------------------------------------------------------- */
271 /* Safely change the mode bits in the ECR */
272 static int change_mode(struct parport
*pp
, int m
)
274 struct parport_uss720_private
*priv
= pp
->private_data
;
278 if (get_1284_register(pp
, 6, ®
, GFP_KERNEL
))
280 /* Bits <7:5> contain the mode. */
281 mode
= (priv
->reg
[2] >> 5) & 0x7;
284 /* We have to go through mode 000 or 001 */
285 if (mode
> ECR_PS2
&& m
> ECR_PS2
)
286 if (change_mode(pp
, ECR_PS2
))
289 if (m
<= ECR_PS2
&& !(priv
->reg
[1] & 0x20)) {
290 /* This mode resets the FIFO, so we may
291 * have to wait for it to drain first. */
292 unsigned long expire
= jiffies
+ pp
->physport
->cad
->timeout
;
294 case ECR_PPF
: /* Parallel Port FIFO mode */
295 case ECR_ECP
: /* ECP Parallel Port mode */
298 if (get_1284_register(pp
, 6, ®
, GFP_KERNEL
))
300 if (priv
->reg
[2] & 0x01)
302 if (time_after_eq (jiffies
, expire
))
303 /* The FIFO is stuck. */
305 msleep_interruptible(10);
306 if (signal_pending (current
))
312 if (set_1284_register(pp
, 6, m
<< 5, GFP_KERNEL
))
314 if (get_1284_register(pp
, 6, ®
, GFP_KERNEL
))
320 * Clear TIMEOUT BIT in EPP MODE
322 static int clear_epp_timeout(struct parport
*pp
)
326 if (get_1284_register(pp
, 1, &stat
, GFP_KERNEL
))
335 static int uss720_irq(int usbstatus
, void *buffer
, int len
, void *dev_id
)
337 struct parport
*pp
= (struct parport
*)dev_id
;
338 struct parport_uss720_private
*priv
= pp
->private_data
;
340 if (usbstatus
!= 0 || len
< 4 || !buffer
)
342 memcpy(priv
->reg
, buffer
, 4);
343 /* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */
344 if (priv
->reg
[2] & priv
->reg
[1] & 0x10)
345 parport_generic_irq(pp
);
350 static void parport_uss720_write_data(struct parport
*pp
, unsigned char d
)
352 set_1284_register(pp
, 0, d
, GFP_KERNEL
);
355 static unsigned char parport_uss720_read_data(struct parport
*pp
)
359 if (get_1284_register(pp
, 0, &ret
, GFP_KERNEL
))
364 static void parport_uss720_write_control(struct parport
*pp
, unsigned char d
)
366 struct parport_uss720_private
*priv
= pp
->private_data
;
368 d
= (d
& 0xf) | (priv
->reg
[1] & 0xf0);
369 if (set_1284_register(pp
, 2, d
, GFP_KERNEL
))
374 static unsigned char parport_uss720_read_control(struct parport
*pp
)
376 struct parport_uss720_private
*priv
= pp
->private_data
;
377 return priv
->reg
[1] & 0xf; /* Use soft copy */
380 static unsigned char parport_uss720_frob_control(struct parport
*pp
, unsigned char mask
, unsigned char val
)
382 struct parport_uss720_private
*priv
= pp
->private_data
;
387 d
= (priv
->reg
[1] & (~mask
)) ^ val
;
388 if (set_1284_register(pp
, 2, d
, GFP_KERNEL
))
394 static unsigned char parport_uss720_read_status(struct parport
*pp
)
398 if (get_1284_register(pp
, 1, &ret
, GFP_KERNEL
))
403 static void parport_uss720_disable_irq(struct parport
*pp
)
405 struct parport_uss720_private
*priv
= pp
->private_data
;
408 d
= priv
->reg
[1] & ~0x10;
409 if (set_1284_register(pp
, 2, d
, GFP_KERNEL
))
414 static void parport_uss720_enable_irq(struct parport
*pp
)
416 struct parport_uss720_private
*priv
= pp
->private_data
;
419 d
= priv
->reg
[1] | 0x10;
420 if (set_1284_register(pp
, 2, d
, GFP_KERNEL
))
425 static void parport_uss720_data_forward (struct parport
*pp
)
427 struct parport_uss720_private
*priv
= pp
->private_data
;
430 d
= priv
->reg
[1] & ~0x20;
431 if (set_1284_register(pp
, 2, d
, GFP_KERNEL
))
436 static void parport_uss720_data_reverse (struct parport
*pp
)
438 struct parport_uss720_private
*priv
= pp
->private_data
;
441 d
= priv
->reg
[1] | 0x20;
442 if (set_1284_register(pp
, 2, d
, GFP_KERNEL
))
447 static void parport_uss720_init_state(struct pardevice
*dev
, struct parport_state
*s
)
449 s
->u
.pc
.ctr
= 0xc | (dev
->irq_func
? 0x10 : 0x0);
453 static void parport_uss720_save_state(struct parport
*pp
, struct parport_state
*s
)
455 struct parport_uss720_private
*priv
= pp
->private_data
;
458 if (get_1284_register(pp
, 2, NULL
, GFP_ATOMIC
))
461 s
->u
.pc
.ctr
= priv
->reg
[1];
462 s
->u
.pc
.ecr
= priv
->reg
[2];
465 static void parport_uss720_restore_state(struct parport
*pp
, struct parport_state
*s
)
467 struct parport_uss720_private
*priv
= pp
->private_data
;
469 set_1284_register(pp
, 2, s
->u
.pc
.ctr
, GFP_ATOMIC
);
470 set_1284_register(pp
, 6, s
->u
.pc
.ecr
, GFP_ATOMIC
);
471 get_1284_register(pp
, 2, NULL
, GFP_ATOMIC
);
472 priv
->reg
[1] = s
->u
.pc
.ctr
;
473 priv
->reg
[2] = s
->u
.pc
.ecr
;
476 static size_t parport_uss720_epp_read_data(struct parport
*pp
, void *buf
, size_t length
, int flags
)
478 struct parport_uss720_private
*priv
= pp
->private_data
;
481 if (change_mode(pp
, ECR_EPP
))
483 for (; got
< length
; got
++) {
484 if (get_1284_register(pp
, 4, (char *)buf
, GFP_KERNEL
))
487 if (priv
->reg
[0] & 0x01) {
488 clear_epp_timeout(pp
);
492 change_mode(pp
, ECR_PS2
);
496 static size_t parport_uss720_epp_write_data(struct parport
*pp
, const void *buf
, size_t length
, int flags
)
499 struct parport_uss720_private
*priv
= pp
->private_data
;
502 if (change_mode(pp
, ECR_EPP
))
504 for (; written
< length
; written
++) {
505 if (set_1284_register(pp
, 4, (char *)buf
, GFP_KERNEL
))
508 if (get_1284_register(pp
, 1, NULL
, GFP_KERNEL
))
510 if (priv
->reg
[0] & 0x01) {
511 clear_epp_timeout(pp
);
515 change_mode(pp
, ECR_PS2
);
518 struct parport_uss720_private
*priv
= pp
->private_data
;
519 struct usb_device
*usbdev
= priv
->usbdev
;
525 if (change_mode(pp
, ECR_EPP
))
527 i
= usb_bulk_msg(usbdev
, usb_sndbulkpipe(usbdev
, 1), (void *)buf
, length
, &rlen
, 20000);
529 printk(KERN_ERR
"uss720: sendbulk ep 1 buf %p len %Zu rlen %u\n", buf
, length
, rlen
);
530 change_mode(pp
, ECR_PS2
);
535 static size_t parport_uss720_epp_read_addr(struct parport
*pp
, void *buf
, size_t length
, int flags
)
537 struct parport_uss720_private
*priv
= pp
->private_data
;
540 if (change_mode(pp
, ECR_EPP
))
542 for (; got
< length
; got
++) {
543 if (get_1284_register(pp
, 3, (char *)buf
, GFP_KERNEL
))
546 if (priv
->reg
[0] & 0x01) {
547 clear_epp_timeout(pp
);
551 change_mode(pp
, ECR_PS2
);
555 static size_t parport_uss720_epp_write_addr(struct parport
*pp
, const void *buf
, size_t length
, int flags
)
557 struct parport_uss720_private
*priv
= pp
->private_data
;
560 if (change_mode(pp
, ECR_EPP
))
562 for (; written
< length
; written
++) {
563 if (set_1284_register(pp
, 3, *(char *)buf
, GFP_KERNEL
))
566 if (get_1284_register(pp
, 1, NULL
, GFP_KERNEL
))
568 if (priv
->reg
[0] & 0x01) {
569 clear_epp_timeout(pp
);
573 change_mode(pp
, ECR_PS2
);
577 static size_t parport_uss720_ecp_write_data(struct parport
*pp
, const void *buffer
, size_t len
, int flags
)
579 struct parport_uss720_private
*priv
= pp
->private_data
;
580 struct usb_device
*usbdev
= priv
->usbdev
;
586 if (change_mode(pp
, ECR_ECP
))
588 i
= usb_bulk_msg(usbdev
, usb_sndbulkpipe(usbdev
, 1), (void *)buffer
, len
, &rlen
, 20000);
590 printk(KERN_ERR
"uss720: sendbulk ep 1 buf %p len %Zu rlen %u\n", buffer
, len
, rlen
);
591 change_mode(pp
, ECR_PS2
);
595 static size_t parport_uss720_ecp_read_data(struct parport
*pp
, void *buffer
, size_t len
, int flags
)
597 struct parport_uss720_private
*priv
= pp
->private_data
;
598 struct usb_device
*usbdev
= priv
->usbdev
;
604 if (change_mode(pp
, ECR_ECP
))
606 i
= usb_bulk_msg(usbdev
, usb_rcvbulkpipe(usbdev
, 2), buffer
, len
, &rlen
, 20000);
608 printk(KERN_ERR
"uss720: recvbulk ep 2 buf %p len %Zu rlen %u\n", buffer
, len
, rlen
);
609 change_mode(pp
, ECR_PS2
);
613 static size_t parport_uss720_ecp_write_addr(struct parport
*pp
, const void *buffer
, size_t len
, int flags
)
617 if (change_mode(pp
, ECR_ECP
))
619 for (; written
< len
; written
++) {
620 if (set_1284_register(pp
, 5, *(char *)buffer
, GFP_KERNEL
))
624 change_mode(pp
, ECR_PS2
);
628 static size_t parport_uss720_write_compat(struct parport
*pp
, const void *buffer
, size_t len
, int flags
)
630 struct parport_uss720_private
*priv
= pp
->private_data
;
631 struct usb_device
*usbdev
= priv
->usbdev
;
637 if (change_mode(pp
, ECR_PPF
))
639 i
= usb_bulk_msg(usbdev
, usb_sndbulkpipe(usbdev
, 1), (void *)buffer
, len
, &rlen
, 20000);
641 printk(KERN_ERR
"uss720: sendbulk ep 1 buf %p len %Zu rlen %u\n", buffer
, len
, rlen
);
642 change_mode(pp
, ECR_PS2
);
646 /* --------------------------------------------------------------------- */
648 static struct parport_operations parport_uss720_ops
=
650 .owner
= THIS_MODULE
,
651 .write_data
= parport_uss720_write_data
,
652 .read_data
= parport_uss720_read_data
,
654 .write_control
= parport_uss720_write_control
,
655 .read_control
= parport_uss720_read_control
,
656 .frob_control
= parport_uss720_frob_control
,
658 .read_status
= parport_uss720_read_status
,
660 .enable_irq
= parport_uss720_enable_irq
,
661 .disable_irq
= parport_uss720_disable_irq
,
663 .data_forward
= parport_uss720_data_forward
,
664 .data_reverse
= parport_uss720_data_reverse
,
666 .init_state
= parport_uss720_init_state
,
667 .save_state
= parport_uss720_save_state
,
668 .restore_state
= parport_uss720_restore_state
,
670 .epp_write_data
= parport_uss720_epp_write_data
,
671 .epp_read_data
= parport_uss720_epp_read_data
,
672 .epp_write_addr
= parport_uss720_epp_write_addr
,
673 .epp_read_addr
= parport_uss720_epp_read_addr
,
675 .ecp_write_data
= parport_uss720_ecp_write_data
,
676 .ecp_read_data
= parport_uss720_ecp_read_data
,
677 .ecp_write_addr
= parport_uss720_ecp_write_addr
,
679 .compat_write_data
= parport_uss720_write_compat
,
680 .nibble_read_data
= parport_ieee1284_read_nibble
,
681 .byte_read_data
= parport_ieee1284_read_byte
,
684 /* --------------------------------------------------------------------- */
686 static int uss720_probe(struct usb_interface
*intf
,
687 const struct usb_device_id
*id
)
689 struct usb_device
*usbdev
= usb_get_dev(interface_to_usbdev(intf
));
690 struct usb_host_interface
*interface
;
691 struct usb_host_endpoint
*endpoint
;
692 struct parport_uss720_private
*priv
;
697 dev_dbg(&intf
->dev
, "probe: vendor id 0x%x, device id 0x%x\n",
698 le16_to_cpu(usbdev
->descriptor
.idVendor
),
699 le16_to_cpu(usbdev
->descriptor
.idProduct
));
701 /* our known interfaces have 3 alternate settings */
702 if (intf
->num_altsetting
!= 3) {
706 i
= usb_set_interface(usbdev
, intf
->altsetting
->desc
.bInterfaceNumber
, 2);
707 dev_dbg(&intf
->dev
, "set interface result %d\n", i
);
709 interface
= intf
->cur_altsetting
;
712 * Allocate parport interface
714 priv
= kzalloc(sizeof(struct parport_uss720_private
), GFP_KERNEL
);
720 priv
->usbdev
= usbdev
;
721 kref_init(&priv
->ref_count
);
722 spin_lock_init(&priv
->asynclock
);
723 INIT_LIST_HEAD(&priv
->asynclist
);
724 pp
= parport_register_port(0, PARPORT_IRQ_NONE
, PARPORT_DMA_NONE
, &parport_uss720_ops
);
726 printk(KERN_WARNING
"uss720: could not register parport\n");
731 pp
->private_data
= priv
;
732 pp
->modes
= PARPORT_MODE_PCSPP
| PARPORT_MODE_TRISTATE
| PARPORT_MODE_EPP
| PARPORT_MODE_ECP
| PARPORT_MODE_COMPAT
;
734 /* set the USS720 control register to manual mode, no ECP compression, enable all ints */
735 set_1284_register(pp
, 7, 0x00, GFP_KERNEL
);
736 set_1284_register(pp
, 6, 0x30, GFP_KERNEL
); /* PS/2 mode */
737 set_1284_register(pp
, 2, 0x0c, GFP_KERNEL
);
739 get_1284_register(pp
, 0, ®
, GFP_KERNEL
);
740 dev_dbg(&intf
->dev
, "reg: %7ph\n", priv
->reg
);
742 endpoint
= &interface
->endpoint
[2];
743 dev_dbg(&intf
->dev
, "epaddr %d interval %d\n",
744 endpoint
->desc
.bEndpointAddress
, endpoint
->desc
.bInterval
);
745 parport_announce_port(pp
);
747 usb_set_intfdata(intf
, pp
);
751 kill_all_async_requests_priv(priv
);
752 kref_put(&priv
->ref_count
, destroy_priv
);
756 static void uss720_disconnect(struct usb_interface
*intf
)
758 struct parport
*pp
= usb_get_intfdata(intf
);
759 struct parport_uss720_private
*priv
;
760 struct usb_device
*usbdev
;
762 dev_dbg(&intf
->dev
, "disconnect\n");
763 usb_set_intfdata(intf
, NULL
);
765 priv
= pp
->private_data
;
766 usbdev
= priv
->usbdev
;
769 dev_dbg(&intf
->dev
, "parport_remove_port\n");
770 parport_remove_port(pp
);
771 parport_put_port(pp
);
772 kill_all_async_requests_priv(priv
);
773 kref_put(&priv
->ref_count
, destroy_priv
);
775 dev_dbg(&intf
->dev
, "disconnect done\n");
778 /* table of cables that work through this driver */
779 static const struct usb_device_id uss720_table
[] = {
780 { USB_DEVICE(0x047e, 0x1001) },
781 { USB_DEVICE(0x0557, 0x2001) },
782 { USB_DEVICE(0x0729, 0x1284) },
783 { USB_DEVICE(0x1293, 0x0002) },
784 { USB_DEVICE(0x050d, 0x0002) },
785 { } /* Terminating entry */
788 MODULE_DEVICE_TABLE (usb
, uss720_table
);
791 static struct usb_driver uss720_driver
= {
793 .probe
= uss720_probe
,
794 .disconnect
= uss720_disconnect
,
795 .id_table
= uss720_table
,
798 /* --------------------------------------------------------------------- */
800 MODULE_AUTHOR(DRIVER_AUTHOR
);
801 MODULE_DESCRIPTION(DRIVER_DESC
);
802 MODULE_LICENSE("GPL");
804 static int __init
uss720_init(void)
807 retval
= usb_register(&uss720_driver
);
811 printk(KERN_INFO KBUILD_MODNAME
": " DRIVER_VERSION
":"
813 printk(KERN_INFO KBUILD_MODNAME
": NOTE: this is a special purpose "
814 "driver to allow nonstandard\n");
815 printk(KERN_INFO KBUILD_MODNAME
": protocols (eg. bitbang) over "
816 "USS720 usb to parallel cables\n");
817 printk(KERN_INFO KBUILD_MODNAME
": If you just want to connect to a "
818 "printer, use usblp instead\n");
823 static void __exit
uss720_cleanup(void)
825 usb_deregister(&uss720_driver
);
828 module_init(uss720_init
);
829 module_exit(uss720_cleanup
);
831 /* --------------------------------------------------------------------- */