From: Johan Hovold <johan@kernel.org>
To: Charles Yeh <charlesyeh522@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
charles-yeh@prolific.com.tw
Subject: Re: [PATCH] USB: serial: pl2303: Modify the detection method of PL2303HXN (TYPE_HXN)
Date: Mon, 20 Jun 2022 11:39:18 +0200 [thread overview]
Message-ID: <YrBARs5dfARHW9Rl@hovoldconsulting.com> (raw)
In-Reply-To: <20220617133514.357-1-charlesyeh522@gmail.com>
On Fri, Jun 17, 2022 at 09:35:14PM +0800, Charles Yeh wrote:
> 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?
> 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.
> 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.
> Signed-off-by: Charles Yeh <charlesyeh522@gmail.com>
> ---
> 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;
> }
Johan
next prev parent reply other threads:[~2022-06-20 9:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 13:35 [PATCH] USB: serial: pl2303: Modify the detection method of PL2303HXN (TYPE_HXN) Charles Yeh
2022-06-20 9:39 ` Johan Hovold [this message]
2022-06-20 10:51 ` Charles Yeh
2022-06-20 12:41 ` Johan Hovold
2022-06-21 4:41 ` Charles Yeh
2022-06-21 8:06 ` Johan Hovold
2022-06-21 8:17 ` Charles Yeh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YrBARs5dfARHW9Rl@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=charles-yeh@prolific.com.tw \
--cc=charlesyeh522@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox