On Tue, 20 Sep 2022, Lukas Wunner wrote: > 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. I don't think you can just move from one to another like that because DE and RTS are not the same signal on these UARTs. So it's not going to be compatible w/o additional effort anyway. Initially, I tried to add a flag for selecting between the HW one and emulation but got overruled (you were among the opposing people ;-)). ...IIRC, I tried to explain back then that those signals are not the same with this HW. -- i. > Personally I'm in favor of the polarity you've chosen. It's too late > to change now anyway. > > Thanks, > > Lukas >