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


Groups > linux.kernel > #1536979 > unrolled thread

Re: [PATCH] serial: mxs-auart: support CMSPAR termios cflag

Started byStefan Wahren <stefan.wahren@i2se.com>
First post2016-12-06 14:40 +0100
Last post2016-12-06 17:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  Re: [PATCH] serial: mxs-auart: support CMSPAR termios cflag Stefan Wahren <stefan.wahren@i2se.com> - 2016-12-06 14:40 +0100
    Re: [PATCH] serial: mxs-auart: support CMSPAR termios cflag Wolfgang Ocker <weo@reccoware.de> - 2016-12-06 17:00 +0100

#1536979 — Re: [PATCH] serial: mxs-auart: support CMSPAR termios cflag

FromStefan Wahren <stefan.wahren@i2se.com>
Date2016-12-06 14:40 +0100
SubjectRe: [PATCH] serial: mxs-auart: support CMSPAR termios cflag
Message-ID<sLo8q-2Cu-29@gated-at.bofh.it>
Hi Wolfgang,

> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -95,6 +95,7 @@
>  #define AUART_LINECTRL_BAUD_DIVFRAC_SHIFT	8
>  #define AUART_LINECTRL_BAUD_DIVFRAC_MASK	0x00003f00
>  #define AUART_LINECTRL_BAUD_DIVFRAC(v)		(((v) & 0x3f) << 8)
> +#define AUART_LINECTRL_SPS			(1 << 7)
>  #define AUART_LINECTRL_WLEN_MASK		0x00000060
>  #define AUART_LINECTRL_WLEN(v)			(((v) & 0x3) << 5)
>  #define AUART_LINECTRL_FEN			(1 << 4)
> @@ -1010,10 +1011,12 @@ static void mxs_auart_settermios(struct uart_port *u,
> 	ctrl |= AUART_LINECTRL_WLEN(bm);
> 
> 	/* parity */
> -	if (cflag & PARENB) {
> +	if (cflag & (PARENB|CMSPAR)) {

does it make sense to enable stick parity in case parity is disabled?

The i.MX28 reference manual doesn't describe this case explicit.

Stefan

[toc] | [next] | [standalone]


#1537074

FromWolfgang Ocker <weo@reccoware.de>
Date2016-12-06 17:00 +0100
Message-ID<sLqjU-3Y9-19@gated-at.bofh.it>
In reply to#1536979
On Tue, 2016-12-06 at 14:36 +0100, Stefan Wahren wrote:
> Hi Wolfgang,
> 
> > --- a/drivers/tty/serial/mxs-auart.c
> > +++ b/drivers/tty/serial/mxs-auart.c
> > @@ -95,6 +95,7 @@
> >  #define AUART_LINECTRL_BAUD_DIVFRAC_SHIFT	8
> >  #define AUART_LINECTRL_BAUD_DIVFRAC_MASK	0x00003f00
> >  #define AUART_LINECTRL_BAUD_DIVFRAC(v)		(((v) & 0x3f) << 8)
> > +#define AUART_LINECTRL_SPS			(1 << 7)
> >  #define AUART_LINECTRL_WLEN_MASK		0x00000060
> >  #define AUART_LINECTRL_WLEN(v)			(((v) & 0x3) << 5)
> >  #define AUART_LINECTRL_FEN			(1 << 4)
> > @@ -1010,10 +1011,12 @@ static void mxs_auart_settermios(struct uart_port
> > *u,
> > 	ctrl |= AUART_LINECTRL_WLEN(bm);
> > 
> > 	/* parity */
> > -	if (cflag & PARENB) {
> > +	if (cflag & (PARENB|CMSPAR)) {
> 
> does it make sense to enable stick parity in case parity is disabled?
> 
> The i.MX28 reference manual doesn't describe this case explicit.

Thanks Stefan for the hint. I think it's okay on the hardware side since the
PEN bit is always set and therefore it can not happen that SPS is set but not
PEN.

But on the termios side it makes sense to require PARENB to be set in c_cflag
if CMSPAR is requested.

So I will provide an updated patch soon.

Wolfgang

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web