Re: [PATCH v4 04/13] serial: 8250_dwlib: RS485 HW half & full duplex support

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

 



On Mon, Apr 25, 2022 at 05:34:01PM +0300, Ilpo Järvinen wrote:
> +	/* Reset to default polarity */
> +	tcr |= DW_UART_TCR_DE_POL;
> +	tcr &= ~DW_UART_TCR_RE_POL;
> +
> +	if (!(rs485->flags & SER_RS485_RTS_ON_SEND))
> +		tcr &= ~DW_UART_TCR_DE_POL;
> +	if (device_property_read_bool(p->dev, "rs485-rx-active-high"))
> +		tcr |= DW_UART_TCR_RE_POL;

Something that only occurred to me after this got merged:

You're using "identity" polarity for hardware-driven Driver Enable,
i.e. if SER_RS485_RTS_ON_SEND is set, then DE is driven high on send.

The em485 software-driven Driver Enable on the other hand uses the
opposite polarity for historical reasons.

So if someone has been using RS485 with software emulation so far on
a DesignWare 4.0 UART, they'll have to change their ACPI tables or
DeviceTree once they move to a kernel which includes the above-quoted
patch.  Such users probably don't exist because the DesignWare 4.0 UART
was introduced relatively recently.

Personally I'm in favor of the polarity you've chosen.  It's too late
to change now anyway.

Thanks,

Lukas



[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