Re: [PATCH v2 2/2] tty: imx serial: Implement support for reversing TX and RX polarity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello George,

On Mon, Feb 10, 2020 at 01:29:49PM -0600, George Hilliard wrote:
> @@ -1390,6 +1392,8 @@ static int imx_uart_startup(struct uart_port *port)
>  	ucr4 = imx_uart_readl(sport, UCR4) & ~UCR4_OREN;
>  	if (!sport->dma_is_enabled)
>  		ucr4 |= UCR4_OREN;
> +	if (sport->inverted_rx)
> +		ucr4 |= UCR4_INVR;

You fail to clear this bit if .inverted_rx is false.

>  	imx_uart_writel(sport, ucr4, UCR4);
>  
>  	ucr2 = imx_uart_readl(sport, UCR2) & ~UCR2_ATEN;
> @@ -1404,19 +1408,17 @@ static int imx_uart_startup(struct uart_port *port)
>  		ucr2 &= ~UCR2_RTSEN;
>  	imx_uart_writel(sport, ucr2, UCR2);
>  
> +	ucr3 = imx_uart_readl(sport, UCR3);
> +	if (sport->inverted_tx)
> +		ucr3 |= UCR3_INVT;

ditto.

Also I think setting this bit here is a bit late because UCR2_TXEN was
already set so changing UCR3_INVT probably results in a spike?!

>  	if (!imx_uart_is_imx1(sport)) {
> -		u32 ucr3;
> -
> -		ucr3 = imx_uart_readl(sport, UCR3);
> [...]

Best regards
Uwe

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



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux