Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: mxs-auart: support CMSPAR termios cflag
@ 2016-12-06 13:36 Stefan Wahren
  2016-12-06 15:54 ` Wolfgang Ocker
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Wahren @ 2016-12-06 13:36 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] serial: mxs-auart: support CMSPAR termios cflag
@ 2016-12-12  7:21 Wolfgang Ocker
  2017-01-03  9:24 ` Stefan Wahren
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Ocker @ 2016-12-12  7:21 UTC (permalink / raw)
  To: linux-arm-kernel

If CMSPAR is set in the c_cflag of termios, "stick" parity is enabled.

Tested on an i.MX28 system

Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
---
v2: require PARENB to be also set in termios' c_cflag for CMSPAR
---
 drivers/tty/serial/mxs-auart.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 770454e0dfa3..fd819ea26762 100644
--- 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)
@@ -1014,6 +1015,8 @@ static void mxs_auart_settermios(struct uart_port *u,
 		ctrl |= AUART_LINECTRL_PEN;
 		if ((cflag & PARODD) == 0)
 			ctrl |= AUART_LINECTRL_EPS;
+		if (cflag & CMSPAR)
+			ctrl |= AUART_LINECTRL_SPS;
 	}
 
 	u->read_status_mask = 0;
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] serial: mxs-auart: support CMSPAR termios cflag
@ 2016-11-30 10:16 Wolfgang Ocker
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Ocker @ 2016-11-30 10:16 UTC (permalink / raw)
  To: linux-arm-kernel

If CMSPAR is set in the c_cflag of termios, "stick" parity is enabled.

Tested on an i.MX28 system

Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
---
 drivers/tty/serial/mxs-auart.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 770454e0dfa3..9d344f734d44 100644
--- 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)) {
 		ctrl |= AUART_LINECTRL_PEN;
 		if ((cflag & PARODD) == 0)
 			ctrl |= AUART_LINECTRL_EPS;
+		if (cflag & CMSPAR)
+			ctrl |= AUART_LINECTRL_SPS;
 	}
 
 	u->read_status_mask = 0;
-- 
2.10.0

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

end of thread, other threads:[~2017-01-03  9:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 13:36 [PATCH] serial: mxs-auart: support CMSPAR termios cflag Stefan Wahren
2016-12-06 15:54 ` Wolfgang Ocker
  -- strict thread matches above, loose matches on Subject: below --
2016-12-12  7:21 Wolfgang Ocker
2017-01-03  9:24 ` Stefan Wahren
2016-11-30 10:16 Wolfgang Ocker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox