Skip to content

Commit

Permalink
USB-serial: pl2303: add space/mark parity
Browse files Browse the repository at this point in the history
The device supports it, so why not use it ? Works fine !

Signed-off-by: Frank Schaefer <schaefer.frank@gmx.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Frank Schaefer authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent 25b8286 commit 6dd81b4
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,21 @@ static void pl2303_set_termios(struct tty_struct *tty,
/* For reference buf[5]=3 is mark parity */
/* For reference buf[5]=4 is space parity */
if (cflag & PARODD) {
buf[5] = 1;
dbg("%s - parity = odd", __func__);
if (cflag & CMSPAR) {
buf[5] = 3;
dbg("%s - parity = mark", __func__);
} else {
buf[5] = 1;
dbg("%s - parity = odd", __func__);
}
} else {
buf[5] = 2;
dbg("%s - parity = even", __func__);
if (cflag & CMSPAR) {
buf[5] = 4;
dbg("%s - parity = space", __func__);
} else {
buf[5] = 2;
dbg("%s - parity = even", __func__);
}
}
} else {
buf[5] = 0;
Expand Down

0 comments on commit 6dd81b4

Please sign in to comment.