Skip to content

Commit ae60aac

Browse files
committed
USB: serial: pl2303: add support for more HXN (G) types
Add support for further HXN (G) type devices (GT variant, GL variant, GS variant and GR) and document the bcdDevice mapping. Note that the TA and TB types use the same bcdDevice as some GT and GE variants, respectively, but that the HX status request can be used to determine which is which. Also note that we currently do not distinguish between the various HXN (G) types in the driver but that this may change eventually (e.g. when adding GPIO support). Reported-by: Charles Yeh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] # 5.13 Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent 342fc0c commit ae60aac

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

drivers/usb/serial/pl2303.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -436,22 +436,27 @@ static int pl2303_detect_type(struct usb_serial *serial)
436436
break;
437437
case 0x200:
438438
switch (bcdDevice) {
439-
case 0x100:
439+
case 0x100: /* GC */
440440
case 0x105:
441+
return TYPE_HXN;
442+
case 0x300: /* GT / TA */
443+
if (pl2303_supports_hx_status(serial))
444+
return TYPE_TA;
445+
fallthrough;
441446
case 0x305:
447+
case 0x400: /* GL */
442448
case 0x405:
449+
return TYPE_HXN;
450+
case 0x500: /* GE / TB */
451+
if (pl2303_supports_hx_status(serial))
452+
return TYPE_TB;
453+
fallthrough;
454+
case 0x505:
455+
case 0x600: /* GS */
443456
case 0x605:
444-
/*
445-
* Assume it's an HXN-type if the device doesn't
446-
* support the old read request value.
447-
*/
448-
if (!pl2303_supports_hx_status(serial))
449-
return TYPE_HXN;
450-
break;
451-
case 0x300:
452-
return TYPE_TA;
453-
case 0x500:
454-
return TYPE_TB;
457+
case 0x700: /* GR */
458+
case 0x705:
459+
return TYPE_HXN;
455460
}
456461
break;
457462
}

0 commit comments

Comments
 (0)