diff options
author | Roland Koebler <r.koebler@yahoo.de> | 2009-10-05 13:58:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 14:55:13 -0500 |
commit | 38fcb8309964b94d0c0499982583d7f30b40abec (patch) | |
tree | 48789ffcfd2353b03a146ed46c7d32ef65e33c32 /drivers/usb/serial/ftdi_sio.c | |
parent | d71cb81af3817193bc605de061da0499934263a6 (diff) |
USB: serial: ftdi_sio: add space/mark parity
Add mark and space parity, since the device supports it.
Signed-off-by: Roland Koebler <r.koebler@yahoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index ebcc6d0e2e91..a8103e0347ee 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -2195,15 +2195,21 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2195 | 2195 | ||
2196 | /* Set number of data bits, parity, stop bits */ | 2196 | /* Set number of data bits, parity, stop bits */ |
2197 | 2197 | ||
2198 | termios->c_cflag &= ~CMSPAR; | ||
2199 | |||
2200 | urb_value = 0; | 2198 | urb_value = 0; |
2201 | urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : | 2199 | urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : |
2202 | FTDI_SIO_SET_DATA_STOP_BITS_1); | 2200 | FTDI_SIO_SET_DATA_STOP_BITS_1); |
2203 | urb_value |= (cflag & PARENB ? | 2201 | if (cflag & PARENB) { |
2204 | (cflag & PARODD ? FTDI_SIO_SET_DATA_PARITY_ODD : | 2202 | if (cflag & CMSPAR) |
2205 | FTDI_SIO_SET_DATA_PARITY_EVEN) : | 2203 | urb_value |= cflag & PARODD ? |
2206 | FTDI_SIO_SET_DATA_PARITY_NONE); | 2204 | FTDI_SIO_SET_DATA_PARITY_MARK : |
2205 | FTDI_SIO_SET_DATA_PARITY_SPACE; | ||
2206 | else | ||
2207 | urb_value |= cflag & PARODD ? | ||
2208 | FTDI_SIO_SET_DATA_PARITY_ODD : | ||
2209 | FTDI_SIO_SET_DATA_PARITY_EVEN; | ||
2210 | } else { | ||
2211 | urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; | ||
2212 | } | ||
2207 | if (cflag & CSIZE) { | 2213 | if (cflag & CSIZE) { |
2208 | switch (cflag & CSIZE) { | 2214 | switch (cflag & CSIZE) { |
2209 | case CS5: urb_value |= 5; dbg("Setting CS5"); break; | 2215 | case CS5: urb_value |= 5; dbg("Setting CS5"); break; |