Skip to content

Commit f97e96c

Browse files
oneukumgregkh
authored andcommitted
cdc-acm: new quirk for EPSON HMD
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>
1 parent b2f6648 commit f97e96c

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/usb/class/cdc-acm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,12 @@ static int acm_probe(struct usb_interface *intf,
12251225
if (!data_interface || !control_interface)
12261226
return -ENODEV;
12271227
goto skip_normal_probe;
1228+
} else if (quirks == NO_UNION_12) {
1229+
data_interface = usb_ifnum_to_if(usb_dev, 2);
1230+
control_interface = usb_ifnum_to_if(usb_dev, 1);
1231+
if (!data_interface || !control_interface)
1232+
return -ENODEV;
1233+
goto skip_normal_probe;
12281234
}
12291235

12301236
/* normal probing*/
@@ -1748,6 +1754,9 @@ static const struct usb_device_id acm_ids[] = {
17481754
{ USB_DEVICE(0x045b, 0x024D), /* Renesas R-Car E3 USB Download mode */
17491755
.driver_info = DISABLE_ECHO, /* Don't echo banner */
17501756
},
1757+
{ USB_DEVICE(0x04b8, 0x0d12), /* EPSON HMD Com&Sens */
1758+
.driver_info = NO_UNION_12, /* union descriptor is garbage */
1759+
},
17511760
{ USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; andrey.arapov@gmail.com */
17521761
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
17531762
},

drivers/usb/class/cdc-acm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,4 @@ struct acm {
114114
#define SEND_ZERO_PACKET BIT(6)
115115
#define DISABLE_ECHO BIT(7)
116116
#define MISSING_CAP_BRK BIT(8)
117+
#define NO_UNION_12 BIT(9)

0 commit comments

Comments
 (0)