All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Yeh <charlesyeh522@gmail.com>
To: gregkh@linuxfoundation.org, johan@kernel.org, linux-usb@vger.kernel.org
Cc: charles-yeh@prolific.com.tw, Charles Yeh <charlesyeh522@gmail.com>
Subject: USB:Serial:pl2303:Add new Pull-UP Mode to support PL2303HXD(TYPE_HX)
Date: Tue, 15 Jan 2019 23:15:36 +0800	[thread overview]
Message-ID: <20190115151536.3084-1-charlesyeh522@gmail.com> (raw)

The Pull-UP mode only support PL2303HXD,it needs to use addition schematic design.

Signed-off-by: Charles Yeh <charlesyeh522@gmail.com>
---
 drivers/usb/serial/pl2303.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 98e7a5df0f6d..72544e5c928d 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -144,6 +144,9 @@ MODULE_DEVICE_TABLE(usb, id_table);
 #define UART_OVERRUN_ERROR		0x40
 #define UART_CTS			0x80
 
+#define TYPE_HX_PULLUP_MODE_DATA	0x08
+#define TYPE_HX_PULLUP_MODE_REG		0x09
+
 static void pl2303_set_break(struct usb_serial_port *port, bool enable);
 
 enum pl2303_type {
@@ -687,6 +690,15 @@ static void pl2303_set_termios(struct tty_struct *tty,
 		pl2303_vendor_write(serial, 0x0, 0x0);
 	}
 
+	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);
+	if (*buf == TYPE_HX_PULLUP_MODE_DATA) {
+		pl2303_vendor_write(serial, 0x0, 0x31);
+		pl2303_vendor_write(serial, 0x1, 0x01);
+	}
+
 	kfree(buf);
 }
 

             reply	other threads:[~2019-01-15 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 15:15 Charles Yeh [this message]
2019-01-16 11:18 USB:Serial:pl2303:Add new Pull-UP Mode to support PL2303HXD(TYPE_HX) Johan Hovold
2019-01-17  6:19 Yeh.Charles [葉榮鑫]
2019-01-17 16:48 Johan Hovold

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=20190115151536.3084-1-charlesyeh522@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 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.