提交 73f59308 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

USB: ch341: fix termios handling

The ch341 currently doesn't support most of the hardware setting.  So to keep
the termios data right we propogate the old termios hardware values back then
encode the speed.
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7cc7ee28
...@@ -272,9 +272,6 @@ static void ch341_set_termios(struct usb_serial_port *port, ...@@ -272,9 +272,6 @@ static void ch341_set_termios(struct usb_serial_port *port,
dbg("ch341_set_termios()"); dbg("ch341_set_termios()");
if (!tty || !tty->termios)
return;
baud_rate = tty_get_baud_rate(tty); baud_rate = tty_get_baud_rate(tty);
switch (baud_rate) { switch (baud_rate) {
...@@ -299,6 +296,11 @@ static void ch341_set_termios(struct usb_serial_port *port, ...@@ -299,6 +296,11 @@ static void ch341_set_termios(struct usb_serial_port *port,
* (cflag & PARENB) : parity {NONE, EVEN, ODD} * (cflag & PARENB) : parity {NONE, EVEN, ODD}
* (cflag & CSTOPB) : stop bits [1, 2] * (cflag & CSTOPB) : stop bits [1, 2]
*/ */
/* Copy back the old hardware settings */
tty_termios_copy_hw(tty->termios, old_termios);
/* And re-encode with the new baud */
tty_encode_baud_rate(tty, baud_rate, baud_rate);
} }
static struct usb_driver ch341_driver = { static struct usb_driver ch341_driver = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册