Re: [PATCH] USB: serial: pl2303: Modify the detection method of PL2303HXN (TYPE_HXN)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux