From: Charles Yeh <charlesyeh522@gmail.com>
To: Johan Hovold <johan@kernel.org>
Cc: "Greg KH" <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org,
"Yeh.Charles [葉榮鑫]" <charles-yeh@prolific.com.tw>
Subject: Re: [PATCH] [PATCH v6] USB: serial: pl2303: Add new PID to support PL2303HXN (TYPE_HXN)
Date: Wed, 3 Jul 2019 00:22:45 +0800 [thread overview]
Message-ID: <CAAZvQQ6JDgkC2SD4eYzBVYhq3ApMwWc_-gXQQVMBH+CaXZSK5A@mail.gmail.com> (raw)
In-Reply-To: <20190701152942.GA3787@localhost>
>
> pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL,
> PL2303_HXN_FLOWCTRL_MASK,
> PL2303_HXN_CTRL_RTS_CTS);
>
Indent continuation lines at least two tabs<<--Done.
> I'm asking why you write the value 0 instead of 3 (or say, 0xfc)? Your
> documentation said bit 0 and 1 are used to reset the up and downstream
> pipes.
>
> To be more specific; what happens if I
>
> 1. set bit 0
> 2. clear bit 0?
>
> and leave the other bits alone (write back the same value, e.g. 0xfe).
>
You are right..
set "1" is reset.
set "0" is nothing.
I have used pl2303_update_reg instead pl2303_vendor_write which to reset
the upstream and downstream pipe data
Charles.
Johan Hovold <johan@kernel.org> 於 2019年7月1日 週一 下午11:29寫道:
>
> On Mon, Jul 01, 2019 at 11:11:02PM +0800, Charles Yeh wrote:
> > > > + if (spriv->quirks & PL2303_QUIRK_LEGACY) {
> > > > + pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK,
> > > > + 0x40);
> > >
> > > No need to break this line even if you end up with slightly more than 80
> > > chars.
> > >
> > OK. I will ignore "WARNING: line over 80 characters".
>
> Yeah, it's ok to go slightly above 80 chars when it improves readability.
>
> > > > + } else if (spriv->type == &pl2303_type_data[TYPE_HXN]) {
> > > > + pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL,
> > > > + PL2303_HXN_FLOWCTRL_MASK,
> > > > + PL2303_HXN_CTRL_RTS_CTS);
> > >
> > > Again, continuation lines should be indented at least two tabs further
> > > (you only use one tab now).
> > >
> >
> > I have done it the way you do today...but after checking
> > ./scripts/checkpatch.pl.. I got another warning message...
> > So I am a little confused now...
> > Previously before submitting.. must first pass ./scripts/checkpatch.pl
> > check. No ERROR, or WARRING message...
> >
> > I will return to the office tomorrow ... I will post another warning
> > message (according to the way you mentioned)
>
> checkpatch isn't always right. Just remember to indent continuation
> lines at least two tabs further, such as
>
> pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL,
> PL2303_HXN_FLOWCTRL_MASK,
> PL2303_HXN_CTRL_RTS_CTS);
>
> > > } else if (spriv->type == &pl2303_type_data[TYPE_HXN]) {
> > >
> > > > + pl2303_vendor_write(serial, PL2303_HXN_RESET_CONTROL,
> > > > + 0);
> > >
> > > You again completely ignored my question about why you're wring 0
> > > instead of 3 here.
> > >
> > > I'll ignore your patch until you explain.
> >
> > 3. In pl2303_open: Because TYPE_HXN is different from the instruction of reset
> > down/up stream used by TYPE_HX.
> > Therefore, we will also execute different instructions here.
> > The default of chip Reset Control is 0xFF(TYPE_HXN), therefore we will
> > write 0x00 to reset down/up stream(TYPE_HXN).
>
> I'm asking why you write the value 0 instead of 3 (or say, 0xfc)? Your
> documentation said bit 0 and 1 are used to reset the up and downstream
> pipes.
>
> To be more specific; what happens if I
>
> 1. set bit 0
> 2. clear bit 0?
>
> and leave the other bits alone (write back the same value, e.g. 0xfe).
>
> Johan
next prev parent reply other threads:[~2019-07-02 16:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 12:21 [PATCH] [PATCH v6] USB: serial: pl2303: Add new PID to support PL2303HXN (TYPE_HXN) Charles Yeh
2019-07-01 13:32 ` Johan Hovold
2019-07-01 13:35 ` Johan Hovold
2019-07-01 15:11 ` Charles Yeh
2019-07-01 15:29 ` Johan Hovold
2019-07-02 16:22 ` Charles Yeh [this message]
2019-07-16 8:33 ` Johan Hovold
2019-07-16 10:42 ` Charles Yeh
2019-08-27 7:07 ` 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=CAAZvQQ6JDgkC2SD4eYzBVYhq3ApMwWc_-gXQQVMBH+CaXZSK5A@mail.gmail.com \
--to=charlesyeh522@gmail.com \
--cc=charles-yeh@prolific.com.tw \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.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).