USB: serial: pl2303: Modify the detection method of PL2303HXN (TYPE_HXN)
Subsystems (2)
PATCH 1/1 USB: serial: pl2303: Modify the detection method of PL2303HXN (TYPE_HXN)
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.
--- drivers/usb/serial/pl2303.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/usb/serial/pl2303.c +11 -10
@@ -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 ; }
Signature · 1 line
2.34.1
Johan Hovold
maintainerQuoted 2 lines · Charles Yeh
The setting value of bcdUSB & bcdDevice of PL2303TA is the same as the setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN
Which ones would that be?
Quoted 2 lines
The setting value of bcdUSB & bcdDevice of PL2303TB is the same as the setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN
Same question here.
Quoted 3 lines
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.
Even if we've found out that the hard way that the documented bdcDevice for these chips does not match your datasheets, it still seems we're able to determine the HXN types (GC, GS, etc) based on bcdDevice and this is something we'll likely need sooner or later.
Could you provide a list of the bcdDevice you use for the various HXN types instead?
Then we can use the hx_status check for TA and TB whose bcdDevice have been reused.
Quoted 33 lines
Signed-off-by Charles Yeh <[email protected]>--- drivers/usb/serial/pl2303.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/usb/serial/pl2303.c +11
-5@@ -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. */
drivers/usb/serial/pl2303.c static int pl2303_detect_type(struct usb_serial *serial) · line 458
Quoted 10 lines
drivers/usb/serial/pl2303.c +0
-5if (!pl2303_supports_hx_status (serial))return TYPE_HXN ; -break ; -case 0x300 : -return TYPE_TA ; -case 0x500 : -return TYPE_TB ; }break ; }
Johan
Quoted 4 lines
Quoted 2 lines
The setting value of bcdUSB & bcdDevice of PL2303TA is the same as the setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN
Which ones would that be?
PL2303GT_R4 (chip version: v4) is the same as PL2303TA.
PL2303TA:
Bus 003 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
Couldn't open device, some information will be missing Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x067b Prolific Technology, Inc. idProduct 0x2303 PL2303 Serial Port / Mobile Action MA-8910P bcdDevice 3.00 iManufacturer 1 Prolific Technology Inc. iProduct 2 USB-Serial Controller iSerial 0 bNumConfigurations 1
PL2303GT_R4 (chip version: v4)
Bus 001 Device 005: ID 067b:23c3 Prolific Technology, Inc. USB-Serial Controller Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x067b Prolific Technology, Inc. idProduct 0x23c3 bcdDevice 3.00 iManufacturer 1 Prolific Technology Inc. iProduct 2 USB-Serial Controller iSerial 3 BGEK6178R45 bNumConfigurations 1
Quoted 4 lines
Quoted 2 lines
The setting value of bcdUSB & bcdDevice of PL2303TB is the same as the setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN
Same question here.
PL2303GE_R4 (chip version: v4) is the same as PL2303TB.
Quoted 2 lines
Could you provide a list of the bcdDevice you use for the various HXN types instead?
I also hope to have a complete list of all HXN versions..
But it is difficult.. I use PL2303GT as an example.
PL2303GT is currently divided into PL2303GT_R4 / PL2303GT_R5 / PL2303GT_R5+
PL2303GT_R4 : idProduct : 0x23C3, bcdDevice: 0x0300 PL2303GT_R5 : idProduct : 0x23C3, bcdDevice: 0x0305 PL2303GT_R5+ : idProduct : 0x23A3, bcdDevice: 0x0305
The above three kinds of PL2303GT are currently available in the market.
From the bcdUSB & bcdDevice of PL2303GT_R4, it is the same as PL2303TA. So it needs to be checked again with hx_status check.
As mentioned earlier, some HXNs are currently on sale,
and some HXN versions are coming out (bcdDevice will have other settings), HXN cannot use bcdDevice to determine the type one by one.
Charles.
Johan Hovold
maintainerQuoted 6 lines · Charles Yeh
Quoted 4 lines
Quoted 2 lines
The setting value of bcdUSB & bcdDevice of PL2303TA is the same as the setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN
Which ones would that be?
PL2303GT_R4(chip version: v4) is the same as PL2303TA.
[...]
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
The setting value of bcdUSB & bcdDevice of PL2303TB is the same as the setting value of bcdUSB & bcdDevice of a certain chip of PL2303HXN
Same question here.
PL2303GE_R4(chip version: v4) is the same as PL2303TB.
Thanks for the details.
Quoted 7 lines
Quoted 2 lines
Could you provide a list of the bcdDevice you use for the various HXN types instead?
I also hope to have a complete list of all HXN versions..
But it is difficult.. I use PL2303GT as an example.
PL2303GT is currently divided intoPL2303GT_R4/PL2303GT_R5/ PL2303GT_R5+
Quoted 5 lines
PL2303GT_R4: idProduct :0x23C3, bcdDevice:0x0300PL2303GT_R5: idProduct :0x23C3, bcdDevice:0x0305PL2303GT_R5+ : idProduct :0x23A3, bcdDevice:0x0305The above three kinds of PL2303GT are currently available in the market.
Ok, but the above could be handled with two entries or if needed we can just check the major number (i.e. the MSB, 0x03)?
Do the other types follow a similar pattern?
So far I've gathered that
0x100 GC 0x105 GC 0x300 GT / TA 0x305 GT 0x405 GL 0x500 GE / TB 0x605 GS
So it look like we could use the major version number.
Anything more we need to add to the above list?
Quoted 2 lines
From the bcdUSB & bcdDevice of
PL2303GT_R4, it is the same as PL2303TA. So it needs to be checked again withhx_statuscheck.
Right, the 0x300 and 0x500 need special handling.
Quoted 3 lines
As mentioned earlier, some HXNs are currently on sale,
and some HXN versions are coming out (bcdDevice will have other settings), HXN cannot use bcdDevice to determine the type one by one.
Surely you have way to determine the types since they have different features. Are you not using bcdDevice for this for that other OS?
Johan
Quoted 2 lines
Ok, but the above could be handled with two entries or if needed we can just check the major number (i.e. the MSB,
0x03)?
No , MSB:0x03 represents the HXN_GT (PL2303GT) version, but the current HXN version has multiple IC types, for example, the bcdDevice_MSB of HXN_GS uses 0x60.
HXN_GS: PL2303GS_R4 : idProduct : 0x23F3, bcdDevice: 0x0600HXN_GS: PL2303GS_R5 : idProduct : 0x23F3, bcdDevice: 0x0605HXN_GS: PL2303GS_R5+ : idProduct : 0x23A3, bcdDevice: 0x0605
The difference between R4 and R5 is that bcdDevice is a different set value. The difference between R5 and R5+ is that idProduct is a different set value. But PL2303GS_R4 / PL2303GS_R5 / PL2303GS_R5+ all represent HXN_GS chip.
Quoted 10 lines
So far I've gathered that
0x100 GC 0x105 GC 0x300 GT / TA 0x305 GT 0x405 GL 0x500 GE / TB 0x605 GS
Quoted 3 lines
So it look like we could use the major version number.
Anything more we need to add to the above list?
Currently there are HXN ICs on the market:
PL2303GC : 0x0100 / 0x0105
PL2303GT : 0x0300 / 0x0305
PL2303GL : 0x0400 / 0x0405
PL2303GE : 0x0500 / 0x0505
PL2303GS : 0x0600 / 0x0605
PL2303GR : 0x0700 / 0x0705
I think it is not very good to add the above bcdDevice to the list.
Because the company's PM/Sales are still planning some HXN ICs (these ICs will be sold according to market behavior in the future, and there will be different bcdDevices: 0x0800 / 0x0805/ 0x0900 / 0x0905.....). so in the future Time, it will become to add different bcdDevice values from time to time, which will become the patch file is always updated.
In the current newest Linux driver program design,
using bcdUSB (0x0100 / 0x0200) as a judgment.
I hope that when bcdUSB==0x0200 is encountered,
I only need to judge whether it is PL2303TA/PL2303TB chip, and the rest is to use HX_Status to judge whether it is HXN_TYPE chip.
There is no need to use bcdDevice one by one to determine which HXN_TYPE (PL2303GC, PL2303GT....)
At present, if our customers need special functions or chip version control in HXN_TYPE IC ,
we will provide special customized files or patch files
General customers only need to identify as HXN_TYPE on Linux OS.
Charles.
Johan Hovold
maintainerQuoted 6 lines · Charles Yeh
Quoted 2 lines
Ok, but the above could be handled with two entries or if needed we can just check the major number (i.e. the MSB,
0x03)?No , MSB:0x03 represents the
HXN_GT(PL2303GT) version, but the current HXN version has multiple IC types, for example, thebcdDevice_MSBofHXN_GSuses0x60.
That's precisely what I was referring to.
Quoted 7 lines
HXN_GS:PL2303GS_R4: idProduct :0x23F3, bcdDevice:0x0600HXN_GS:PL2303GS_R5: idProduct :0x23F3, bcdDevice:0x0605HXN_GS: PL2303GS_R5+ : idProduct :0x23A3, bcdDevice:0x0605The difference between R4 and R5 is that bcdDevice is a different set value. The difference between R5 and R5+ is that idProduct is a different set value. But
PL2303GS_R4/PL2303GS_R5/ PL2303GS_R5+ all representHXN_GSchip.
Right.
Quoted 14 lines
Quoted 10 lines
So far I've gathered that
0x100 GC 0x105 GC 0x300 GT / TA 0x305 GT 0x405 GL 0x500 GE / TB 0x605 GSQuoted 3 lines
So it look like we could use the major version number.
Anything more we need to add to the above list?
Quoted 7 lines
Currently there are HXN ICs on the market:
PL2303GC :0x0100/0x0105
PL2303GT :0x0300/0x0305
PL2303GL :0x0400/0x0405
PL2303GE :0x0500/0x0505
PL2303GS :0x0600/0x0605
PL2303GR :0x0700/0x0705
Thanks for filling in the blanks.
Quoted 7 lines
I think it is not very good to add the above bcdDevice to the list.
Because the company's PM/Sales are still planning some HXN ICs (these ICs will be sold according to market behavior in the future, and there will be different bcdDevices:
0x0800/ 0x0805/0x0900/0x0905.....). so in the future Time, it will become to add different bcdDevice values from time to time, which will become the patch file is always updated.
That's no problem. We'd be happy to add support for any new types as well.
It's much easier to get this right from the start than to try to retrofit it when you realise that you need it (e.g. as we had to do with the older types).
Quoted 5 lines
In the current newest Linux driver program design,
using bcdUSB (0x0100/0x0200) as a judgment.
I hope that when bcdUSB==0x0200 is encountered,
I only need to judge whether it is PL2303TA/PL2303TB chip, and the rest is to useHX_Statusto judge whether it isHXN_TYPEchip.
I understand, and that would be enough to detect HXN, but not the individual HXN types which is what I want to do.
Quoted 6 lines
There is no need to use bcdDevice one by one to determine which
HXN_TYPE(PL2303GC, PL2303GT....)At present, if our customers need special functions or chip version control in
HXN_TYPEIC ,
we will provide special customized files or patch files
That's not a practice I would recommend, it's better that you add proper support to the mainline driver so that all users can benefit.
I'm sure your customers would prefer to use a mainline driver as well.
Quoted 1 line
General customers only need to identify as
HXN_TYPEon Linux OS.
I'm afraid I don't agree with that.
I'll prepare a patch that adds support for the missing HXN types.
Johan
Quoted 1 line
I'll prepare a patch that adds support for the missing HXN types.
OK. Thanks for your kindly help.
Charles.