lkml.org 
[lkml]   [2016]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 21/22] usb: serial: ti_usb_3410_5052: Add CMSPAR support
Date
Add CMSPAR support in set_termios callback.
Move TI_UART_ENABLE_PARITY_CHECKING setting in the upper
block to avoid doing it twice.
Delete useless TI_UART_ENABLE_PARITY_CHECKING unsetting.

Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
---
drivers/usb/serial/ti_usb_3410_5052.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 168a969..50324b4 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1031,19 +1031,20 @@ static void ti_set_termios(struct tty_struct *tty,
break;
}

- /* CMSPAR isn't supported by this driver */
- tty->termios.c_cflag &= ~CMSPAR;
-
if (C_PARENB(tty)) {
- if (C_PARODD(tty)) {
- wflags |= TI_UART_ENABLE_PARITY_CHECKING;
- config->bParity = TI_UART_ODD_PARITY;
+ wflags |= TI_UART_ENABLE_PARITY_CHECKING;
+ if (C_CMSPAR(tty)) {
+ if (C_PARODD(tty))
+ config->bParity = TI_UART_MARK_PARITY;
+ else
+ config->bParity = TI_UART_SPACE_PARITY;
} else {
- wflags |= TI_UART_ENABLE_PARITY_CHECKING;
- config->bParity = TI_UART_EVEN_PARITY;
+ if (C_PARODD(tty))
+ config->bParity = TI_UART_ODD_PARITY;
+ else
+ config->bParity = TI_UART_EVEN_PARITY;
}
} else {
- wflags &= ~TI_UART_ENABLE_PARITY_CHECKING;
config->bParity = TI_UART_NO_PARITY;
}

--
2.9.0
\
 
 \ /
  Last update: 2016-07-26 20:41    [W:0.159 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site