Patch against current git (9824b8f11373b0df806c135a342da9319ef1d893)
From: Tollef Fog Heen <tfheen@err.no>
* Implement support for all baud rates rather than just a hard coded set.
* Make it possible to control status and control lines
Signed-off-by: Tollef Fog Heen <tfheen@err.no>
---
Documentation/usb/usb-serial.txt | 2 +
drivers/usb/serial/ch341.c | 421 +++++++++++++++++++++++++++++++-------
2 files changed, 348 insertions(+), 75 deletions(-)
diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt
index ff2c1ff..201ec84 100644
--- a/Documentation/usb/usb-serial.txt
+++ b/Documentation/usb/usb-serial.txt
@@ -434,6 +434,8 @@ Winchiphead CH341 Driver
The manufacturer's website: http://www.winchiphead.com/.
For any questions or problems with this driver, please contact
frank@kingswood-consulting.co.uk.
+ Extensions for universal baudrate settings and modem status/control have
+ been added by werner <at> cornelius-consult.de.
Generic Serial driver
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index f61e3ca..22ca0c2 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -1,5 +1,7 @@
/*
* Copyright 2007, Frank A Kingswood <frank@kingswood-consulting.co.uk>
+ * Copyright 2007, Werner Cornelius <werner <at> cornelius-consult.de>
+ * Copyright 2008, Tollef Fog Heen <tfheen@err.no>
*
* ch341.c implements a serial port driver for the Winchiphead CH341.
*
@@ -24,6 +26,36 @@
#define DEFAULT_BAUD_RATE 2400
#define DEFAULT_TIMEOUT 1000
+/* flags for IO-Bits */
+#define CH341_BIT_RTS (1 << 6)
+#define CH341_BIT_DTR (1 << 5)
+
+/******************************/
+/* interrupt pipe definitions */
+/******************************/
+/* always 4 interrupt bytes */
+/* first irq byte normally 0x08 */
+/* second irq byte base 0x7d + below */
+/* third irq byte base 0x94 + below */
+/* fourth irq byte normally 0xee */
+
+/* second interrupt byte */
+#define ...