提交 29cf1b72 编写于 作者: F Frank Schaefer 提交者: Greg Kroah-Hartman

USB-serial: pl2303: use 1.5 instead of 2 stop bits with 5 data bits

This is how "real" UARTs (e.g. 16550) work and AFAIK what RS232 specifies, too.
Make the driver more compliant.
Signed-off-by: NFrank Schaefer <schaefer.frank@gmx.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 6dd81b45
...@@ -622,8 +622,16 @@ static void pl2303_set_termios(struct tty_struct *tty, ...@@ -622,8 +622,16 @@ static void pl2303_set_termios(struct tty_struct *tty,
/* For reference buf[4]=1 is 1.5 stop bits */ /* For reference buf[4]=1 is 1.5 stop bits */
/* For reference buf[4]=2 is 2 stop bits */ /* For reference buf[4]=2 is 2 stop bits */
if (cflag & CSTOPB) { if (cflag & CSTOPB) {
buf[4] = 2; /* NOTE: Comply with "real" UARTs / RS232:
dbg("%s - stop bits = 2", __func__); * use 1.5 instead of 2 stop bits with 5 data bits
*/
if ((cflag & CSIZE) == CS5) {
buf[4] = 1;
dbg("%s - stop bits = 1.5", __func__);
} else {
buf[4] = 2;
dbg("%s - stop bits = 2", __func__);
}
} else { } else {
buf[4] = 0; buf[4] = 0;
dbg("%s - stop bits = 1", __func__); dbg("%s - stop bits = 1", __func__);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册