summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Schaefer <schaefer.frank@gmx.net>2009-08-18 20:31:11 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-23 15:46:36 +0200
commit6dd81b45fd7628f3eb308f387aee696366718f25 (patch)
treee9473229dd5af7fc40b167f04c346c8171366118
parentUSB-serial: pl2303: fix baud rate handling in case of unsupported values (diff)
downloadlinux-6dd81b45fd7628f3eb308f387aee696366718f25.tar.xz
linux-6dd81b45fd7628f3eb308f387aee696366718f25.zip
USB-serial: pl2303: add space/mark parity
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>
-rw-r--r--drivers/usb/serial/pl2303.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 82055b07e02c..6ed33c7e53e2 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -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;