linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Charles Yeh <charlesyeh522@gmail.com>
Cc: "Johan Hovold" <johan@kernel.org>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	"Yeh.Charles [葉榮鑫]" <charles-yeh@prolific.com.tw>
Subject: Re: [PATCH] USB:serial:pl2303:Add new PID to support PL2303HXN (TYPE_HXN)
Date: Wed, 17 Apr 2019 13:13:40 +0200	[thread overview]
Message-ID: <20190417111340.GA2520@localhost> (raw)
Message-ID: <20190417111340.QitXzENeultS5nK3-dt9vhKgYMzgAPJa9xl1I3UV07k@z> (raw)
In-Reply-To: <CAAZvQQ6JHwZ+iOo02s45SqYUo2sV3o49VJ3QGkL4Yh9Pyi_mMA@mail.gmail.com>

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

  parent reply	other threads:[~2019-04-17 11:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 12:30 USB:serial:pl2303:Add new PID to support PL2303HXN (TYPE_HXN) Charles Yeh
2019-04-02  7:22 ` Johan Hovold
2019-04-09  9:52   ` Charles Yeh
2019-04-09  9:52     ` [PATCH] " Charles Yeh
2019-04-12  2:33     ` Charles Yeh
2019-04-12  2:33       ` [PATCH] " Charles Yeh
2019-04-15  8:56     ` Johan Hovold
2019-04-15  8:56       ` [PATCH] " Johan Hovold
2019-04-17 10:50       ` Charles Yeh
2019-04-17 10:50         ` [PATCH] " Charles Yeh
2019-04-17 11:13         ` Johan Hovold [this message]
2019-04-17 11:13           ` Johan Hovold
2019-04-17 13:48           ` Charles Yeh
2019-04-17 13:48             ` [PATCH] " Charles Yeh
2019-02-19  6:47 Charles Yeh
2019-03-04  1:24 Charles Yeh
2019-04-03  4:51 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=20190417111340.GA2520@localhost \
    --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;
as well as URLs for NNTP newsgroup(s).