Re: serial: usb: cdc-acm: OMRON B5L ToF, device probe failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 23.06.22 04:26, Chris Ruehl wrote:

Hi,

> thanks for that patch, I can confirm it works for me. I have the ToF up
> and running at B921600 8N1.
> But I would wait, not apply to the kernel, because I noticed that the
> team from OMRON is working
> on the CDC implantation.
> So this patch is only a workaround for the moment.
> 

if you absolutely want it to be driven from CDC-ACM, try this
new attached patch.
In your original patch you used NO_UNION_NORMAL. That will allow
a device to work without a union descriptor but with the normal
two interfaces. This devices has what in terms of ACM is a collapsed
interface without a union descriptor.
The driver provides for that but then it checks for the exact
number of required endpoints, which is three. Your device has
four endpoints.
The patch ignores a fourth endpoint.

	Regards
		Oliver
From 4be11052c6e43771625af54a64473610ceacdf77 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@xxxxxxxx>
Date: Thu, 23 Jun 2022 10:22:47 +0200
Subject: [PATCH] cdc-acm: adding a special case for OMRON device

This device has a collapsed interface with a mysterious
fourth endpoint. We ignore that endpoint.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/usb/class/cdc-acm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 9b9aea24d58c..ee62c13a5533 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1215,7 +1215,12 @@ static int acm_probe(struct usb_interface *intf,
 		call_intf_num = cmgmd->bDataInterface;
 
 	if (!union_header) {
-		if (intf->cur_altsetting->desc.bNumEndpoints == 3) {
+		if (intf->cur_altsetting->desc.bNumEndpoints == 3 &&
+				/*
+				 * an odd device from OMRON has a mysterious
+				 * unnecessary fourth endpoint
+				 */
+				intf->cur_altsetting->desc.bNumEndpoints == 4) {
 			dev_dbg(&intf->dev, "No union descriptor, assuming single interface\n");
 			combined_interfaces = 1;
 			control_interface = data_interface = intf;
-- 
2.35.3


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux