]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cdc-acm: new quirk for EPSON HMD
authorOliver Neukum <oneukum@suse.com>
Tue, 17 Mar 2026 08:41:10 +0000 (09:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2026 15:17:22 +0000 (16:17 +0100)
This device has a union descriptor that is just garbage
and needs a custom descriptor.
In principle this could be done with a (conditionally
activated) heuristic. That would match more devices
without a need for defining a new quirk. However,
this always carries the risk that the heuristics
does the wrong thing and leads to more breakage.
Defining the quirk and telling it exactly what to do
is the safe and conservative approach.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@kernel.org>
Link: https://patch.msgid.link/20260317084139.1461008-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-acm.h

index 7ede29d4c7c13491227fec89b0f900b085aa0778..cf3c3eede1a51f08d160f51423a0c3708a92185e 100644 (file)
@@ -1225,6 +1225,12 @@ static int acm_probe(struct usb_interface *intf,
                if (!data_interface || !control_interface)
                        return -ENODEV;
                goto skip_normal_probe;
+       } else if (quirks == NO_UNION_12) {
+               data_interface = usb_ifnum_to_if(usb_dev, 2);
+               control_interface = usb_ifnum_to_if(usb_dev, 1);
+               if (!data_interface || !control_interface)
+                        return -ENODEV;
+               goto skip_normal_probe;
        }
 
        /* normal probing*/
@@ -1748,6 +1754,9 @@ static const struct usb_device_id acm_ids[] = {
        { USB_DEVICE(0x045b, 0x024D),   /* Renesas R-Car E3 USB Download mode */
        .driver_info = DISABLE_ECHO,    /* Don't echo banner */
        },
+       { USB_DEVICE(0x04b8, 0x0d12),   /* EPSON HMD Com&Sens */
+       .driver_info = NO_UNION_12,     /* union descriptor is garbage */
+       },
        { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; andrey.arapov@gmail.com */
        .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
        },
index 76f73853a60b63a9385a9a4b8fd361e693f7d459..25fd5329a8781fbbfa41c146ea685c3fde510786 100644 (file)
@@ -114,3 +114,4 @@ struct acm {
 #define SEND_ZERO_PACKET               BIT(6)
 #define DISABLE_ECHO                   BIT(7)
 #define MISSING_CAP_BRK                        BIT(8)
+#define NO_UNION_12                    BIT(9)