From: Alex Henrie <alexhenrie24@gmail.com>
To: linux-parport@lists.infradead.org, linux-usb@vger.kernel.org,
sudipm.mukherjee@gmail.com, johan@kernel.org,
daniel@gimpelevich.san-francisco.ca.us, hkzlabnet@gmail.com,
reboots@g-cipher.net, mike@trausch.us,
gregkh@linuxfoundation.org
Cc: Alex Henrie <alexhenrie24@gmail.com>
Subject: [PATCH v2 4/4] usb: misc: uss720: check for incompatible versions of the Belkin F5U002
Date: Tue, 26 Mar 2024 09:07:11 -0600 [thread overview]
Message-ID: <20240326150723.99939-5-alexhenrie24@gmail.com> (raw)
In-Reply-To: <20240326150723.99939-1-alexhenrie24@gmail.com>
The incompatible device in my possession has a sticker that says
"F5U002 Rev 2" and "P80453-B", and lsusb identifies it as
"050d:0002 Belkin Components IEEE-1284 Controller". There is a bug
report from 2007 from Michael Trausch who was seeing the exact same
errors that I saw in 2024 trying to use this cable.
Link: https://lore.kernel.org/all/46DE5830.9060401@trausch.us/
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
drivers/usb/misc/uss720.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c
index 5423da08a467..b26c1d382d59 100644
--- a/drivers/usb/misc/uss720.c
+++ b/drivers/usb/misc/uss720.c
@@ -677,7 +677,7 @@ static int uss720_probe(struct usb_interface *intf,
struct parport_uss720_private *priv;
struct parport *pp;
unsigned char reg;
- int i;
+ int ret;
dev_dbg(&intf->dev, "probe: vendor id 0x%x, device id 0x%x\n",
le16_to_cpu(usbdev->descriptor.idVendor),
@@ -688,8 +688,8 @@ static int uss720_probe(struct usb_interface *intf,
usb_put_dev(usbdev);
return -ENODEV;
}
- i = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2);
- dev_dbg(&intf->dev, "set interface result %d\n", i);
+ ret = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2);
+ dev_dbg(&intf->dev, "set interface result %d\n", ret);
interface = intf->cur_altsetting;
@@ -728,12 +728,18 @@ static int uss720_probe(struct usb_interface *intf,
set_1284_register(pp, 7, 0x00, GFP_KERNEL);
set_1284_register(pp, 6, 0x30, GFP_KERNEL); /* PS/2 mode */
set_1284_register(pp, 2, 0x0c, GFP_KERNEL);
- /* debugging */
- get_1284_register(pp, 0, ®, GFP_KERNEL);
+
+ /* The Belkin F5U002 Rev 2 P80453-B USB parallel port adapter shares the
+ * device ID 050d:0002 with some other device that works with this
+ * driver, but it itself does not. Detect and handle the bad cable
+ * here. */
+ ret = get_1284_register(pp, 0, ®, GFP_KERNEL);
dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg);
+ if (ret < 0)
+ return ret;
- i = usb_find_last_int_in_endpoint(interface, &epd);
- if (!i) {
+ ret = usb_find_last_int_in_endpoint(interface, &epd);
+ if (!ret) {
dev_dbg(&intf->dev, "epaddr %d interval %d\n",
epd->bEndpointAddress, epd->bInterval);
}
--
2.44.0
next prev parent reply other threads:[~2024-03-26 15:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 5:50 [PATCH 1/7] docs: driver-api: parport-lowlevel: clarify purpose of PARPORT_MODE_PCSPP Alex Henrie
2024-03-12 5:50 ` [PATCH 2/7] usb: serial: mos7720: don't advertise PARPORT_MODE_PCSPP Alex Henrie
2024-03-12 7:39 ` Johan Hovold
2024-03-12 9:53 ` Sudip Mukherjee
2024-03-12 15:27 ` Daniel Gimpelevich
2024-03-13 1:30 ` Alex Henrie
2024-03-26 9:10 ` Greg KH
2024-03-12 5:50 ` [PATCH 3/7] usb: misc: uss720: " Alex Henrie
2024-03-12 5:50 ` [PATCH 4/7] usb: misc: uss720: point pp->dev to usbdev->dev Alex Henrie
2024-03-12 7:40 ` Johan Hovold
2024-03-13 1:30 ` Alex Henrie
2024-03-13 8:24 ` Johan Hovold
2024-03-26 15:07 ` [PATCH v2 0/4] usb: misc: uss720: improve support for Belkin F5U002 devices Alex Henrie
2024-03-26 15:07 ` [PATCH v2 1/4] usb: misc: uss720: point pp->dev to usbdev->dev Alex Henrie
2024-03-26 20:14 ` Sudip Mukherjee
2024-03-26 15:07 ` [PATCH v2 2/4] usb: misc: uss720: document the names of the compatible devices Alex Henrie
2024-03-26 15:07 ` [PATCH v2 3/4] usb: misc: uss720: add support for another variant of the Belkin F5U002 Alex Henrie
2024-03-26 15:07 ` Alex Henrie [this message]
2024-03-12 5:50 ` [PATCH 5/7] usb: misc: uss720: document the names of the compatible devices Alex Henrie
2024-03-12 16:00 ` Daniel Gimpelevich
2024-03-12 5:50 ` [PATCH 6/7] usb: misc: uss720: add support for another variant of the Belkin F5U002 Alex Henrie
2024-03-12 15:31 ` Daniel Gimpelevich
2024-03-13 1:22 ` Alex Henrie
2024-03-12 5:50 ` [PATCH 7/7] usb: misc: uss720: check for incompatible versions " Alex Henrie
2024-03-12 7:38 ` [PATCH 1/7] docs: driver-api: parport-lowlevel: clarify purpose of PARPORT_MODE_PCSPP Johan Hovold
2024-03-12 15:24 ` Daniel Gimpelevich
2024-03-13 1:18 ` Alex Henrie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240326150723.99939-5-alexhenrie24@gmail.com \
--to=alexhenrie24@gmail.com \
--cc=daniel@gimpelevich.san-francisco.ca.us \
--cc=gregkh@linuxfoundation.org \
--cc=hkzlabnet@gmail.com \
--cc=johan@kernel.org \
--cc=linux-parport@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=mike@trausch.us \
--cc=reboots@g-cipher.net \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox