USB:Serial:pl2303:Add new Pull-UP Mode to support PL2303HXD(TYPE_HX)
Quoted 2 lines · Yeh.Charles [葉榮鑫]
Hi Johan,
Please refer to https://electronics.stackexchange.com/questions/28091/push-pull-open-drain-pull-up-pull-down
Thanks, I know that bit.
I still need a proper commit message describing why the change is needed. You provide some more information below, but it's still not enough for a proper commit message it seems.
What pins are you changing the properties off here? The UART pins or some GPIOs. Please explain in more details what this is used for.
And the magic constants needs to go away in favour of defines.
Quoted 2 lines
" Your are also enabling this for all current devices " <<--No, it needs to use addition schematic design.
I meant that you are enabling this new code for all device types unconditionally yet you say it's only needed for HXD.
Quoted 5 lines
It needs special PCB and special PL2303HXD, and then enable Pull-up mode..
" special PL2303HXD ": Prolific will release a custom-made PL2303HXD OTP( 6.5V ) writer to customer. The OTP writer will record a "Data:0x08" at "Address:
0x09".
Ok, that's another piece to the pussle, thanks. Remember to include it in the commit message too.
Quoted 12 lines
pl2303_startupfunction:pl2303_vendor_read(serial, 0x8484, buf);pl2303_vendor_write(serial, 0x0404, 0);pl2303_vendor_read(serial, 0x8484, buf);pl2303_vendor_read(serial, 0x8383, buf);
pl2303_vendor_read(serial, 0x8484, buf);pl2303_vendor_write(serial, 0x0404, 1);pl2303_vendor_read(serial, 0x8484, buf);pl2303_vendor_read(serial, 0x8383, buf);
Quoted 8 lines
pl2303_set_termiosfunction:pl2303_vendor_read(serial, 0x8484, buf);pl2303_vendor_write(serial, 0x0404, TYPE_HX_PULLUP_MODE_REG);pl2303_vendor_read(serial, 0x8484, buf);pl2303_vendor_read(serial, 0x8383, buf);You can see the same code in "
pl2303_startup" function, it can be found from v.2.4.31 and above Linux kernel.
It's not really the same code is it? First of all it's only run at probe, not at every set_termios call; why did you add it there?
Second, the current code appears to read from address 0 and 1, not address 9.
Quoted 1 line
So you want me to also change
pl2303_startupfunction ?
If you could clean up that code with proper defines and a comment about what is going on, that would be great.
Thanks,
Johan