Skip to content

Commit

Permalink
tty: serial: mpc5xxx: add support for mark/space parity
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Greg Kroah-Hartman committed Sep 5, 2012
1 parent bbb63c5 commit d3dec96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/tty/serial/mpc52xx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d3dec96

Please sign in to comment.