USB: serial: pl2303: add support for more HXN (G) types
Subsystems (3)
Johan Hovold
maintainerPATCH 1/1 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).
--- drivers/usb/serial/pl2303.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)
drivers/usb/serial/pl2303.c +17 -12
@@ -436,22 +436,27 @@ static int pl2303_detect_type(struct usb_serial *serial)break ;case 0x200 :switch (bcdDevice) { -case 0x100 : +case 0x100 :/* GC */ case 0x105 : +return TYPE_HXN ; +case 0x300 :/* GT / TA */ +if (pl2303_supports_hx_status (serial)) +return TYPE_TA ; + fallthrough;case 0x305 : +case 0x400 :/* GL */ case 0x405 : +return TYPE_HXN ; +case 0x500 :/* GE / TB */ +if (pl2303_supports_hx_status (serial)) +return TYPE_TB ; + fallthrough; +case 0x505 : +case 0x600 :/* GS */ case 0x605 : -/* -* 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 ; +case 0x700 :/* GR */ +case 0x705 : +return TYPE_HXN ; }break ; }
Signature · 1 line
2.35.1
Quoted 66 lines · Johan Hovold
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]>Cc [email protected] # 5.13Signed-off-by Johan Hovold <[email protected]>--- drivers/usb/serial/pl2303.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)drivers/usb/serial/pl2303.c +17
-12@@ -436,22 +436,27 @@ static int pl2303_detect_type(struct usb_serial *serial)break ;case 0x200 :switch (bcdDevice) { -case 0x100 : +case 0x100 :/* GC */ case 0x105 : +return TYPE_HXN ; +case 0x300 :/* GT / TA */ +if (pl2303_supports_hx_status (serial)) +return TYPE_TA ; + fallthrough;case 0x305 : +case 0x400 :/* GL */ case 0x405 : +return TYPE_HXN ; +case 0x500 :/* GE / TB */ +if (pl2303_supports_hx_status (serial)) +return TYPE_TB ; + fallthrough; +case 0x505 : +case 0x600 :/* GS */ case 0x605 : -/* -* 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 ; +case 0x700 :/* GR */ +case 0x705 : +return TYPE_HXN ; }break ; }Signature · 1 line
2.35.1
Johan Hovold
maintainerQuoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Johan Hovold
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).
Quoted 6 lines
Quoted 4 lines
Reported-by Charles Yeh <[email protected]>Cc [email protected] # 5.13Signed-off-by Johan Hovold <[email protected]>Reviewed-by Greg Kroah-Hartman <[email protected]>
Thanks for reviewing. Now applied.
Johan