Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1450748

[PATCH v2 21/22] usb: serial: ti_usb_3410_5052: Add CMSPAR support

From Mathieu OTHACEHE <m.othacehe@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 21/22] usb: serial: ti_usb_3410_5052: Add CMSPAR support
Date 2016-07-26 20:10 +0200
Message-ID <rZeXM-5o9-47@gated-at.bofh.it> (permalink)
References <rZeXL-5o9-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/22] usb: serial: ti_usb_3410_5052: clean driver Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 18/22] usb: serial: ti_usb_3410_5052: Standardize debug and error messages Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
    Re: [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc  instead of kmalloc Oliver Neukum <oneukum@suse.com> - 2016-07-27 10:20 +0200
      Re: [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-27 14:50 +0200
    Re: [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc  instead of kmalloc Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-07-27 13:30 +0200
  [PATCH v2 07/22] usb: serial: ti_usb_3410_5052: Use macros instead of magic values Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 14/22] usb: serial: ti_usb_3410_5052: Do not set shadow mcr in open callback Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 16/22] usb: serial: ti_usb_3410_5052: Raise DTR and RTS flags if speed is not null anymore Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 20/22] usb: serial: ti_usb_3410_5052: Set shadow msr before waking up waiters Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 15/22] usb: serial: ti_usb_3410_5052: Check old_termios parameter in set_termios Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 08/22] usb: serial: ti_usb_3410_5052: Remove in_sync and out_sync functions Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 21/22] usb: serial: ti_usb_3410_5052: Add CMSPAR support Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 19/22] usb: serial: ti_usb_3410_5052: Use variables for vendor and product Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 06/22] usb: serial: ti_usb_3410_5052: Remove unused variables Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 13/22] usb: serial: ti_usb_3410_5052: Change ti_get/set_serial_info function arguments Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 09/22] usb: serial: ti_usb_3410_5052: Remove useless tty_wakeup Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 04/22] usb: serial: ti_usb_3410_5052: Remove useless NULL-testing Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
  [PATCH v2 01/22] usb: serial: ti_usb_3410_5052: Do not use __uX types Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:20 +0200

csiph-web