lkml.org 
[lkml]   [2018]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] serial: imx: warn user when using unsupported configuration
Hello Stefan,

On Wed, Apr 18, 2018 at 03:32:17PM +0200, Stefan Agner wrote:
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 91f3a1a5cb7f..1ba7e98ddc76 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -1833,6 +1833,10 @@ static int imx_uart_rs485_config(struct uart_port *port,
> rs485conf->flags &= ~SER_RS485_ENABLED;
>
> if (rs485conf->flags & SER_RS485_ENABLED) {
> + /* Enable receiver if low-active RTS signal is requested */
> + if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND)
> + rs485conf->flags |= SER_RS485_RX_DURING_TX;
> +

this is wrong if RTS is driven by a GPIO.

> /* disable transmitter */
> ucr2 = imx_uart_readl(sport, UCR2);
> if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND)
> @@ -2265,6 +2269,17 @@ static int imx_uart_probe(struct platform_device *pdev)
> (!sport->have_rtscts && !sport->have_rtsgpio))
> dev_err(&pdev->dev, "no RTS control, disabling rs485\n");
>
> + /*
> + * The RTS (CTS_B) signal cannot be set low during transmission
> + * in case the receiver is off (limitation of the i.MX UART IP).
> + */
> + if (sport->port.rs485.flags & SER_RS485_ENABLED && sport->have_rtscts &&
> + (!(sport->port.rs485.flags & SER_RS485_RTS_ON_SEND) &&
> + !(sport->port.rs485.flags & SER_RS485_RX_DURING_TX)))
> + dev_err(&pdev->dev,
> + "low-active RTS not possible when receiver is off, "
> + "enabling receiver\n");

If you have the choice between breaking a user visible string and a code
line >80 chars, please pick the latter.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |

\
 
 \ /
  Last update: 2018-04-18 15:47    [W:0.033 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site