[PATCH] USB: serial: pl2303: Modify the detection method of PL2303HXN (TYPE_HXN)

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

 



The setting value of bcdUSB & bcdDevice of PL2303TA is the same as the
setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN

The setting value of bcdUSB & bcdDevice of PL2303TB is the same as the
setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN

The PL2303HXN series currently has several chips on sale, and several chips
are about to be sold.
The PL2303HXN cannot use bcdDevice to determine the type one by one.

Signed-off-by: Charles Yeh <charlesyeh522@xxxxxxxxx>
---
 drivers/usb/serial/pl2303.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 3506c47e1eef..95e5fdf3b80a 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -436,22 +436,23 @@ static int pl2303_detect_type(struct usb_serial *serial)
 		break;
 	case 0x200:
 		switch (bcdDevice) {
-		case 0x100:
-		case 0x105:
-		case 0x305:
-		case 0x405:
-		case 0x605:
+		case 0x300:
+			if (!pl2303_supports_hx_status(serial))
+				return TYPE_HXN;
+			else
+				return TYPE_TA;
+		case 0x500:
+			if (!pl2303_supports_hx_status(serial))
+				return TYPE_HXN;
+			else
+				return TYPE_TB;
+		default:
 			/*
 			 * Assume it's an HXN-type if the device doesn't
 			 * support the old read request value.
 			 */
 			if (!pl2303_supports_hx_status(serial))
 				return TYPE_HXN;
-			break;
-		case 0x300:
-			return TYPE_TA;
-		case 0x500:
-			return TYPE_TB;
 		}
 		break;
 	}
-- 
2.34.1




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

  Powered by Linux