]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
serial: omap: add the functionality of a 9-bit UART with userspaces CMSPAR
authorEnric Balletbo i Serra <eballetbo@iseebcn.com>
Thu, 6 Dec 2012 08:45:04 +0000 (09:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2013 05:52:23 +0000 (21:52 -0800)
Some systems require the additional communication functionality of a
9-bit UART. For that we could use the "stick" (mark/space) parity
bit supported on omap serial device. When is set, if PARODD is set the
parity bit is always 1; if PARODD is not set, then the parity bit is
always 0.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/omap-serial.c

index 57d6b29c039cacd8dbf32d5044101211fdfe1c0c..ec90651d661aab90a0a0ec96a214896fb4c99ae5 100644 (file)
@@ -776,6 +776,8 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
                cval |= UART_LCR_PARITY;
        if (!(termios->c_cflag & PARODD))
                cval |= UART_LCR_EPAR;
+       if (termios->c_cflag & CMSPAR)
+               cval |= UART_LCR_SPAR;
 
        /*
         * Ask the core to calculate the divisor for us.