All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control
@ 2019-08-30  9:58 ` Christoph Vogtländer
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Vogtländer @ 2019-08-30  9:58 UTC (permalink / raw)
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Christoph Vogtländer

As documented in the data-sheet, the transmitter must be disabled before
activating AutoCTS or auto transmitter flow control. Accordingly, the
transmitter must be enabled after AutoCTS or auto transmitter flow
control gets deactivated.

Signed-off-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
---
 drivers/tty/serial/max310x.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index fb5a7e0e58e9..adfef6dae4a7 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -860,6 +860,15 @@ static void max310x_set_termios(struct uart_port *port,
 max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]);
 max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]);

+/* Disable transmitter before enabling AutoCTS or auto transmitter
+ * flow control
+ */
+if (termios->c_cflag & CRTSCTS || termios->c_iflag & IXOFF) {
+max310x_port_update(port, MAX310X_MODE1_REG,
+    MAX310X_MODE1_TXDIS_BIT,
+    MAX310X_MODE1_TXDIS_BIT);
+}
+
 port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);

 if (termios->c_cflag & CRTSCTS) {
@@ -878,6 +887,15 @@ static void max310x_set_termios(struct uart_port *port,
 }
 max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow);

+/* Enable transmitter after disabling AutoCTS and auto transmitter
+ * flow control
+ */
+if (!(termios->c_cflag & CRTSCTS) && !(termios->c_iflag & IXOFF)) {
+max310x_port_update(port, MAX310X_MODE1_REG,
+    MAX310X_MODE1_TXDIS_BIT,
+    0);
+}
+
 /* Get baud rate generator configuration */
 baud = uart_get_baud_rate(port, termios, old,
   port->uartclk / 16 / 0xffff,
--
2.22.1


Sigma Surface Science GmbH, Idsteiner Str. 78, 65232 Taunusstein. Amtsgericht Wiesbaden, HRB 27422. Geschäftsführer: Norbert Nold

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

* [PATCH] serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control
@ 2019-08-30  9:58 ` Christoph Vogtländer
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Vogtländer @ 2019-08-30  9:58 UTC (permalink / raw)
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Christoph Vogtländer

As documented in the data-sheet, the transmitter must be disabled before
activating AutoCTS or auto transmitter flow control. Accordingly, the
transmitter must be enabled after AutoCTS or auto transmitter flow
control gets deactivated.

Signed-off-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
---
 drivers/tty/serial/max310x.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index fb5a7e0e58e9..adfef6dae4a7 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -860,6 +860,15 @@ static void max310x_set_termios(struct uart_port *port,
 max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]);
 max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]);

+/* Disable transmitter before enabling AutoCTS or auto transmitter
+ * flow control
+ */
+if (termios->c_cflag & CRTSCTS || termios->c_iflag & IXOFF) {
+max310x_port_update(port, MAX310X_MODE1_REG,
+    MAX310X_MODE1_TXDIS_BIT,
+    MAX310X_MODE1_TXDIS_BIT);
+}
+
 port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);

 if (termios->c_cflag & CRTSCTS) {
@@ -878,6 +887,15 @@ static void max310x_set_termios(struct uart_port *port,
 }
 max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow);

+/* Enable transmitter after disabling AutoCTS and auto transmitter
+ * flow control
+ */
+if (!(termios->c_cflag & CRTSCTS) && !(termios->c_iflag & IXOFF)) {
+max310x_port_update(port, MAX310X_MODE1_REG,
+    MAX310X_MODE1_TXDIS_BIT,
+    0);
+}
+
 /* Get baud rate generator configuration */
 baud = uart_get_baud_rate(port, termios, old,
   port->uartclk / 16 / 0xffff,
--
2.22.1


Sigma Surface Science GmbH, Idsteiner Str. 78, 65232 Taunusstein. Amtsgericht Wiesbaden, HRB 27422. Geschäftsführer: Norbert Nold

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

* Re: [PATCH] serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control
  2019-08-30  9:58 ` Christoph Vogtländer
  (?)
@ 2019-09-04  7:30 ` Greg Kroah-Hartman
  2019-09-04 12:17     ` Christoph Vogtländer
  -1 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-09-04  7:30 UTC (permalink / raw)
  To: Christoph Vogtländer; +Cc: Jiri Slaby, linux-serial, linux-kernel

On Fri, Aug 30, 2019 at 09:58:41AM +0000, Christoph Vogtländer wrote:
> As documented in the data-sheet, the transmitter must be disabled before
> activating AutoCTS or auto transmitter flow control. Accordingly, the
> transmitter must be enabled after AutoCTS or auto transmitter flow
> control gets deactivated.
> 
> Signed-off-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
> ---
>  drivers/tty/serial/max310x.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index fb5a7e0e58e9..adfef6dae4a7 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -860,6 +860,15 @@ static void max310x_set_termios(struct uart_port *port,
>  max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]);
>  max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]);
> 
> +/* Disable transmitter before enabling AutoCTS or auto transmitter
> + * flow control
> + */
> +if (termios->c_cflag & CRTSCTS || termios->c_iflag & IXOFF) {
> +max310x_port_update(port, MAX310X_MODE1_REG,
> +    MAX310X_MODE1_TXDIS_BIT,
> +    MAX310X_MODE1_TXDIS_BIT);
> +}
> +
>  port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);
> 
>  if (termios->c_cflag & CRTSCTS) {
> @@ -878,6 +887,15 @@ static void max310x_set_termios(struct uart_port *port,
>  }
>  max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow);
> 
> +/* Enable transmitter after disabling AutoCTS and auto transmitter
> + * flow control
> + */
> +if (!(termios->c_cflag & CRTSCTS) && !(termios->c_iflag & IXOFF)) {
> +max310x_port_update(port, MAX310X_MODE1_REG,
> +    MAX310X_MODE1_TXDIS_BIT,
> +    0);
> +}
> +
>  /* Get baud rate generator configuration */
>  baud = uart_get_baud_rate(port, termios, old,
>    port->uartclk / 16 / 0xffff,
> --
> 2.22.1
> 

Same problem here, this is impossible to apply.

greg k-h

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

* [PATCH] serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control
  2019-09-04  7:30 ` Greg Kroah-Hartman
@ 2019-09-04 12:17     ` Christoph Vogtländer
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Vogtländer @ 2019-09-04 12:17 UTC (permalink / raw)
  Cc: Christoph Vogtländer, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, linux-kernel

As documented in the data-sheet, the transmitter must be disabled before
activating AutoCTS or auto transmitter flow control. Accordingly, the
transmitter must be enabled after AutoCTS or auto transmitter flow
control gets deactivated.

Signed-off-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
---
 drivers/tty/serial/max310x.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index fb5a7e0e58e9..adfef6dae4a7 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -860,6 +860,15 @@ static void max310x_set_termios(struct uart_port *port,
 	max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]);
 	max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]);
 
+	/* Disable transmitter before enabling AutoCTS or auto transmitter
+	 * flow control
+	 */
+	if (termios->c_cflag & CRTSCTS || termios->c_iflag & IXOFF) {
+		max310x_port_update(port, MAX310X_MODE1_REG,
+				    MAX310X_MODE1_TXDIS_BIT,
+				    MAX310X_MODE1_TXDIS_BIT);
+	}
+
 	port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);
 
 	if (termios->c_cflag & CRTSCTS) {
@@ -878,6 +887,15 @@ static void max310x_set_termios(struct uart_port *port,
 	}
 	max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow);
 
+	/* Enable transmitter after disabling AutoCTS and auto transmitter
+	 * flow control
+	 */
+	if (!(termios->c_cflag & CRTSCTS) && !(termios->c_iflag & IXOFF)) {
+		max310x_port_update(port, MAX310X_MODE1_REG,
+				    MAX310X_MODE1_TXDIS_BIT,
+				    0);
+	}
+
 	/* Get baud rate generator configuration */
 	baud = uart_get_baud_rate(port, termios, old,
 				  port->uartclk / 16 / 0xffff,
-- 
2.22.1


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

* [PATCH] serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control
@ 2019-09-04 12:17     ` Christoph Vogtländer
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Vogtländer @ 2019-09-04 12:17 UTC (permalink / raw)
  Cc: Christoph Vogtländer, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, linux-kernel

As documented in the data-sheet, the transmitter must be disabled before
activating AutoCTS or auto transmitter flow control. Accordingly, the
transmitter must be enabled after AutoCTS or auto transmitter flow
control gets deactivated.

Signed-off-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
---
 drivers/tty/serial/max310x.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index fb5a7e0e58e9..adfef6dae4a7 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -860,6 +860,15 @@ static void max310x_set_termios(struct uart_port *port,
 	max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]);
 	max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]);
 
+	/* Disable transmitter before enabling AutoCTS or auto transmitter
+	 * flow control
+	 */
+	if (termios->c_cflag & CRTSCTS || termios->c_iflag & IXOFF) {
+		max310x_port_update(port, MAX310X_MODE1_REG,
+				    MAX310X_MODE1_TXDIS_BIT,
+				    MAX310X_MODE1_TXDIS_BIT);
+	}
+
 	port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);
 
 	if (termios->c_cflag & CRTSCTS) {
@@ -878,6 +887,15 @@ static void max310x_set_termios(struct uart_port *port,
 	}
 	max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow);
 
+	/* Enable transmitter after disabling AutoCTS and auto transmitter
+	 * flow control
+	 */
+	if (!(termios->c_cflag & CRTSCTS) && !(termios->c_iflag & IXOFF)) {
+		max310x_port_update(port, MAX310X_MODE1_REG,
+				    MAX310X_MODE1_TXDIS_BIT,
+				    0);
+	}
+
 	/* Get baud rate generator configuration */
 	baud = uart_get_baud_rate(port, termios, old,
 				  port->uartclk / 16 / 0xffff,
-- 
2.22.1

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

end of thread, other threads:[~2019-09-04 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-30  9:58 [PATCH] serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control Christoph Vogtländer
2019-08-30  9:58 ` Christoph Vogtländer
2019-09-04  7:30 ` Greg Kroah-Hartman
2019-09-04 12:17   ` Christoph Vogtländer
2019-09-04 12:17     ` Christoph Vogtländer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.