linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: mpc5xxx: add support for mark/space parity
@ 2012-08-27 14:03 Wolfram Sang
  2012-08-29 21:56 ` Anatolij Gustschin
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2012-08-27 14:03 UTC (permalink / raw)
  To: linux-serial; +Cc: Wolfram Sang, Anatolij Gustschin, Greg KH

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>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Greg KH <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/mpc52xx_uart.c |    8 ++++++--
 1 file 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;
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tty: serial: mpc5xxx: add support for mark/space parity
  2012-08-27 14:03 [PATCH] tty: serial: mpc5xxx: add support for mark/space parity Wolfram Sang
@ 2012-08-29 21:56 ` Anatolij Gustschin
  0 siblings, 0 replies; 2+ messages in thread
From: Anatolij Gustschin @ 2012-08-29 21:56 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-serial, Greg KH

Hi Wolfram,

On Mon, 27 Aug 2012 16:03:14 +0200
Wolfram Sang <w.sang@pengutronix.de> wrote:

> 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>
> Cc: Anatolij Gustschin <agust@denx.de>
> Cc: Greg KH <gregkh@linuxfoundation.org>
> ---
>  drivers/tty/serial/mpc52xx_uart.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Looks good, so

Acked-by: Anatolij Gustschin <agust@denx.de>

> 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;
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-29 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 14:03 [PATCH] tty: serial: mpc5xxx: add support for mark/space parity Wolfram Sang
2012-08-29 21:56 ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).