summaryrefslogtreecommitdiffstats
path: root/drivers/usb
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 06:46:36 -0700
commit6dd81b45fd7628f3eb308f387aee696366718f25 (patch)
treee9473229dd5af7fc40b167f04c346c8171366118 /drivers/usb
parent25b8286805e856c8c7fda127018e31032c918015 (diff)
downloadop-kernel-dev-6dd81b45fd7628f3eb308f387aee696366718f25.zip
op-kernel-dev-6dd81b45fd7628f3eb308f387aee696366718f25.tar.gz
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>
Diffstat (limited to 'drivers/usb')
-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 82055b0..6ed33c7 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;
OpenPOWER on IntegriCloud