]> www.infradead.org Git - users/willy/xarray.git/commitdiff
usb: misc: uss720: add support for another variant of the Belkin F5U002
authorAlex Henrie <alexhenrie24@gmail.com>
Tue, 26 Mar 2024 15:07:10 +0000 (09:07 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Apr 2024 15:07:48 +0000 (17:07 +0200)
This device is a gray USB parallel port adapter with "F5U002" imprinted
on the plastic and a sticker that says both "F5U002" and "P80453-A".
It's identified in lsusb as "05ab:1001 In-System Design BAYI Printer
Class Support". It's subtly different from the other gray cable I have
that has "F5U002 Rev 2" and "P80453-B" on its sticker and device ID
050d:0002.

The uss720 driver appears to work flawlessly with this device, although
the device evidently does not support ECP.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Link: https://lore.kernel.org/r/20240326150723.99939-4-alexhenrie24@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/uss720.c

index 32caf3ca300f1e41db0618886541dae1fefeb6f6..5423da08a46765928e9dce99dfbdc3e132f16515 100644 (file)
@@ -693,7 +693,7 @@ static int uss720_probe(struct usb_interface *intf,
 
        interface = intf->cur_altsetting;
 
-       if (interface->desc.bNumEndpoints < 3) {
+       if (interface->desc.bNumEndpoints < 2) {
                usb_put_dev(usbdev);
                return -ENODEV;
        }
@@ -719,7 +719,9 @@ static int uss720_probe(struct usb_interface *intf,
 
        priv->pp = pp;
        pp->private_data = priv;
-       pp->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP | PARPORT_MODE_ECP | PARPORT_MODE_COMPAT;
+       pp->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP | PARPORT_MODE_COMPAT;
+       if (interface->desc.bNumEndpoints >= 3)
+               pp->modes |= PARPORT_MODE_ECP;
        pp->dev = &usbdev->dev;
 
        /* set the USS720 control register to manual mode, no ECP compression, enable all ints */
@@ -774,6 +776,7 @@ static const struct usb_device_id uss720_table[] = {
        { USB_DEVICE(0x050d, 0x1202) }, /* Belkin F5U120-PC */
        { USB_DEVICE(0x0557, 0x2001) },
        { USB_DEVICE(0x05ab, 0x0002) }, /* Belkin F5U002 ISD-101 */
+       { USB_DEVICE(0x05ab, 0x1001) }, /* Belkin F5U002 P80453-A */
        { USB_DEVICE(0x06c6, 0x0100) }, /* Infowave ISD-103 */
        { USB_DEVICE(0x0729, 0x1284) },
        { USB_DEVICE(0x1293, 0x0002) },