All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: "Yeh.Charles [葉榮鑫]" <charles-yeh@prolific.com.tw>
Cc: Johan Hovold <johan@kernel.org>,
	Charles Yeh <charlesyeh522@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: USB:Serial:pl2303:Add new Pull-UP Mode to support PL2303HXD(TYPE_HX)
Date: Thu, 17 Jan 2019 17:48:53 +0100	[thread overview]
Message-ID: <20190117164853.GY3691@localhost> (raw)

On Thu, Jan 17, 2019 at 06:19:56AM +0000, Yeh.Charles [葉榮鑫] wrote:
> Hi Johan,
>   Please refer to https://electronics.stackexchange.com/questions/28091/push-pull-open-drain-pull-up-pull-down

Thanks, I know that bit.

I still need a proper commit message describing why the change is
needed. You provide some more information below, but it's still not
enough for a proper commit message it seems.

What pins are you changing the properties off here? The UART pins or
some GPIOs. Please explain in more details what this is used for.

And the magic constants needs to go away in favour of defines.

>   " Your are also enabling this for all current devices " <<--No, it
>   needs to use addition schematic design.

I meant that you are enabling this new code for all device types
unconditionally yet you say it's only needed for HXD.

>     It needs special PCB and special PL2303HXD, and then enable Pull-up mode..
> 
>    " special PL2303HXD ": Prolific will release a custom-made
>    PL2303HXD OTP( 6.5V ) writer to customer. The OTP writer will
>    record a "Data:0x08" at "Address: 0x09".

Ok, that's another piece to the pussle, thanks. Remember to include it
in the commit message too.

> pl2303_startup function:
> pl2303_vendor_read(serial, 0x8484, buf);
> pl2303_vendor_write(serial, 0x0404, 0);
> pl2303_vendor_read(serial, 0x8484, buf);
> pl2303_vendor_read(serial, 0x8383, buf);
> 
> pl2303_vendor_read(serial, 0x8484, buf);
> pl2303_vendor_write(serial, 0x0404, 1);
> pl2303_vendor_read(serial, 0x8484, buf);
> pl2303_vendor_read(serial, 0x8383, buf);
> 
> 
> pl2303_set_termios function:
> pl2303_vendor_read(serial, 0x8484, buf);
> pl2303_vendor_write(serial, 0x0404, TYPE_HX_PULLUP_MODE_REG);
> pl2303_vendor_read(serial, 0x8484, buf);
> pl2303_vendor_read(serial, 0x8383, buf);
> 
> You can see the same code in "pl2303_startup" function, it can be
> found from v.2.4.31 and above Linux kernel.

It's not really the same code is it? First of all it's only run at
probe, not at every set_termios call; why did you add it there?

Second, the current code appears to read from address 0 and 1, not
address 9.

> So you want me to also change pl2303_startup function ?

If you could clean up that code with proper defines and a comment about
what is going on, that would be great.

Thanks,
Johan

             reply	other threads:[~2019-01-17 16:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 16:48 Johan Hovold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-17  6:19 USB:Serial:pl2303:Add new Pull-UP Mode to support PL2303HXD(TYPE_HX) Yeh.Charles [葉榮鑫]
2019-01-16 11:18 Johan Hovold
2019-01-15 15:15 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=20190117164853.GY3691@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.