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

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

 




On 21.06.22 02:38, michael.lee@xxxxxxxxx wrote:
> Dear Chris,
> 
> The below is the reply from Japan.
> 
> Dose they do the below commnad after connect B5L to USB?
> 
> sudo modprobe usbserial vendor=0x0590 product=0x00ca
> sudo chmod o+wr /dev/ttyUSB0
> 
> For linux environment ,this commnad is needed to connect B5L to USB.
> We preapre the below sh file with c++ sample codes.
> connect_tof.sh
> https://github.com/omron-devhub/b5l_TOFsensor_Sample_cpp
> 

Hi,

this is not nice. But in any case this thing is not an ACM
device. This patch should remove it from the driver it is
abusing to where it belongs. Could you please test it?

	Regards
		Oliver
From af01a3666104b4a4f5c2b61c1df0d0e094432b67 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@xxxxxxxx>
Date: Tue, 21 Jun 2022 12:05:04 +0200
Subject: [PATCH] move OMRON B5L from ACM to sgeneric serial

This thing is no ACM, whatever the descriptor may say.
Blacklist and add its ID to serial IDs

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/usb/class/cdc-acm.c            | 4 ++++
 drivers/usb/serial/usb-serial-simple.c | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 9b9aea24d58c..1e1b7f104690 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1928,6 +1928,10 @@ static const struct usb_device_id acm_ids[] = {
 	{ USB_DEVICE(0x058b, 0x0041),
 	.driver_info = IGNORE_DEVICE,
 	},
+	/* OMRON B5L ToF */
+	{ USB_DEVICE(0x0590, 0x00ca),
+	.driver_info = IGNORE_DEVICE,
+	},
 
 	/* Exclude ETAS ES58x */
 	{ USB_DEVICE(0x108c, 0x0159), /* ES581.4 */
diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c
index 4c6747889a19..5040f84528d7 100644
--- a/drivers/usb/serial/usb-serial-simple.c
+++ b/drivers/usb/serial/usb-serial-simple.c
@@ -96,6 +96,11 @@ DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
 	{ USB_DEVICE(0x0421, 0x069a) }	/* Nokia 130 (RM-1035) */
 DEVICE(nokia, NOKIA_IDS);
 
+/* OMRON */
+#define OMRON_IDS() \
+	{ USB_DEVICE(0x0590, 0x00ca) }  /* OMRON B5L ToF */
+DEVICE(omron, OMRON_IDS);
+
 /* Novatel Wireless GPS driver */
 #define NOVATEL_IDS()			\
 	{ USB_DEVICE(0x09d7, 0x0100) }	/* NovAtel FlexPack GPS */
@@ -130,6 +135,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
 	&motorola_tetra_device,
 	&nokia_device,
 	&novatel_gps_device,
+	&omron_device,
 	&hp4x_device,
 	&suunto_device,
 	&siemens_mpi_device,
@@ -148,6 +154,7 @@ static const struct usb_device_id id_table[] = {
 	MOTOROLA_TETRA_IDS(),
 	NOKIA_IDS(),
 	NOVATEL_IDS(),
+	OMRON_IDS(),
 	HP4X_IDS(),
 	SUUNTO_IDS(),
 	SIEMENS_IDS(),
-- 
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