Skip to contentSkip to conversation

serial: mxs-auart: support CMSPAR termios cflag

PATCH Stefan Wahren 2 participants 2 messages Dec 6, 2016

lore
Share & tools
lore
#0 lore raw

Hi Wolfgang,

Quoted 11 lines
drivers/tty/serial/mxs-auart.c +1 -0
@@ -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)

drivers/tty/serial/mxs-auart.c static void mxs_auart_settermios(struct uart_port *u, · line 1014

Quoted 5 lines
drivers/tty/serial/mxs-auart.c +1 -1
@@ -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

#1 lore raw
Quoted 16 lines · Stefan Wahren

Hi Wolfgang,

Quoted 14 lines
drivers/tty/serial/mxs-auart.c +0 -0
@@ -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)

drivers/tty/serial/mxs-auart.c +0 -0
@@ -1010,10 +1011,12 @@ static void mxs_auart_settermios(struct uart_port
 *u,
 	ctrl |= AUART_LINECTRL_WLEN(bm);
 
Quoted 7 lines

drivers/tty/serial/mxs-auart.c static void mxs_auart_settermios(struct uart_port · line 1015

Quoted 3 lines
drivers/tty/serial/mxs-auart.c +1 -1
 	/* 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