Re: [PATCH] USB:serial:pl2303:Add new PID to support PL2303HXN (TYPE_HXN)

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

 



On Wed, Apr 17, 2019 at 06:50:55PM +0800, Charles Yeh wrote:
> Hello Sir,
> 
> Please download the PL2303_Linux_0419.zip from
> https://app.box.com/s/uh9kldrdldjnmjffku8gkdvvaq5496tk
> 
> > > After the actual test (I have tested the old PL2303H chip on Linux),
> > > when I plug in the PL2303H (TYPE_01), the Linux code will execute the code:
> > > if (spriv->quirks & PL2303_QUIRK_LEGACY) itinerary code.
> > > So I confirm This "PL2303_QUIRK_LEGACY" of code refers to PL2303H(TYPE_01)
> >
> > Correct, but my question was about bit 0x20 for TYPE_01 devices; why
> > isn't it being as set as for TYPE_HX?
> >
> 
> TYPE_01 / TYPE_HX / TYPE_HXN are different hardware design.
> Please refer to PL2303_Linux_0419\PL2303_TYPE_01_UART_Flow.jpg &
> PL2303_TYPE_HX_UART_Flow.jpg

Thanks, that will be very helpful.

> > Well, without documentation it is hard to give advice. But the
> > information you provided above, indicates that you should not be
> > overwriting these registers completely for HXN either when updating the
> > flow-control settings. Only the bits 2..4 (and possibly 0..1) should be
> > written.
> >
> > Take a look at the patches I merged for doing this on the older devices.
> > You should be able to use the same helper when updating these
> > registers.
> 
> Please refer to PL2303_Linux_0419\
> PL2303_TYPE_01_UART_Flow.jpg &
> PL2303_TYPE_HX_UART_Flow.jpg &
> PL2303G_TYPE_HXN_UART_Flow.jpg
> 
> 
> 
> If you have other questions (whether it's my newly written patch code or
> the code that originally existed), please try to raise it... Thanks!

I will, thanks. I'm looking at how best to abstract this now.

> The code that originally existed; not what I wrote..
> But I have rewritten many times to a lot of customers...
> probably can also guess the usage of the original code.
> 
> 
> I just used
> "git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
> to get the latest Linux kernel.
> 
> The code I see in the pl2303_set_termios function
> is still pl2303_vendor_write(serial,0x0,0x41),
> Not pl2303_update_reg(serial,0,PL2303_FLOWCTRL_MASK,0x40);

Yes, you need to base it on my usb-next branch (or linux-next):

	git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git

> Can I write a new patch?
> "git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
> But I don't want to rewrite the original code.
> For example "pl2303_vendor_write(serial,0x0,0x41)"
> Because that's the old code.. Not that I added the patch code this time.

Got it, but please take a look my usb-next branch.

I'll try to clean up the current driver some more based on your
feedback. I'll get back to you as soon as have something concrete
and we'll get the HXN support in place.

Meanwhile here are few questions:

 1. Can bcdUSB be used to detect the HXN devices?

 2. Does the old (type 01 and hx) devices require the register address
    to be ORed with 0x80 when reading?

 3. And the HXN does not need that ORing with 0x80 it seems?

 4. How do you use the chip-reset register (0x7) on HXN; do you write
    0x03 if you only want to reset both data pipes?

And please try to respond inline when replying, no need to keep second
copy at the end of your mails.

Thanks,
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