mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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: Frank Schaefer <schaefer.frank@gmx.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6dd81b45fd
commit
29cf1b72f3
1 changed files with 10 additions and 2 deletions
|
@ -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]=2 is 2 stop bits */
|
||||
if (cflag & CSTOPB) {
|
||||
buf[4] = 2;
|
||||
dbg("%s - stop bits = 2", __func__);
|
||||
/* NOTE: Comply with "real" UARTs / RS232:
|
||||
* 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 {
|
||||
buf[4] = 0;
|
||||
dbg("%s - stop bits = 1", __func__);
|
||||
|
|
Loading…
Reference in a new issue