summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/mpc52xx_uart.c
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2012-08-27 16:03:14 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 12:41:57 -0700
commitd3dec96e401cc66d7280732558d711ac2ee7a531 (patch)
tree15542d9993f15d645770f57c37dc5f9899e7a43d /drivers/tty/serial/mpc52xx_uart.c
parentbbb63c514a3464342967237a51a21ea8f61ab951 (diff)
downloadop-kernel-dev-d3dec96e401cc66d7280732558d711ac2ee7a531.zip
op-kernel-dev-d3dec96e401cc66d7280732558d711ac2ee7a531.tar.gz
tty: serial: mpc5xxx: add support for mark/space parity
Tested on a custom MPC5200B-board using some fancy industrial protocol. Verified that MPC512x has identical bits, so should work there as well. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/mpc52xx_uart.c')
-rw-r--r--drivers/tty/serial/mpc52xx_uart.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index bedac0d..f19d04e 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -775,11 +775,15 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
}
if (new->c_cflag & PARENB) {
+ if (new->c_cflag & CMSPAR)
+ mr1 |= MPC52xx_PSC_MODE_PARFORCE;
+
+ /* With CMSPAR, PARODD also means high parity (same as termios) */
mr1 |= (new->c_cflag & PARODD) ?
MPC52xx_PSC_MODE_PARODD : MPC52xx_PSC_MODE_PAREVEN;
- } else
+ } else {
mr1 |= MPC52xx_PSC_MODE_PARNONE;
-
+ }
mr2 = 0;
OpenPOWER on IntegriCloud