On Thu, Sep 14, 2023 at 04:52:21PM -0400, Matthew Howell wrote: > From: Matthew Howell <matthew.howell@xxxxxxxxxxxx> > > Sealevel XR17V35X based cards utilize DTR to control RS-485 Enable, but > the current implementation of 8250_exar uses RTS for the > auto-RS485-Enable mode of the XR17V35X UARTs. This patch implements DTR > Auto-RS485 on Sealevel cards. You have trailing whitespace in your commit log :( Please fix your editor to not do this. > Link: https://lore.kernel.org/all/24b88a50-9c53-82ba-84d1-292c74c81981@xxxxxxxxxxxx/T/ This is not needed, don't link to older emails, that can be done on a 0/X message if you really want one. > Signed-off-by: Matthew Howell <matthew.howell@xxxxxxxxxxxx> > --- > V5->V6 > Split ret in sealevel_rs485_config > V4->V5 > Fixed typo in commit message > Split readb and writeb into multiple lines/variables > Removed "store original LCR" since it was clear from code > Various small fixes to tabs and whitespace > > diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c > index 3886f78ecbbf..34f0e18c7ad8 100644 > --- a/drivers/tty/serial/8250/8250_exar.c > +++ b/drivers/tty/serial/8250/8250_exar.c > @@ -78,6 +78,9 @@ > > #define UART_EXAR_RS485_DLY(x) ((x) << 4) > > +#define UART_EXAR_DLD 0x02 /* Divisor Fractional */ > +#define UART_EXAR_DLD_485_POLARITY 0x80 /* RS-485 Enable Signal Polarity */ Why are these values not lined up? > /* > * IOT2040 MPIO wiring semantics: > * > @@ -439,6 +442,41 @@ static int generic_rs485_config(struct uart_port *port, struct ktermios *termios > return 0; > } > > +static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termios, > + struct serial_rs485 *rs485) > +{ > + u8 __iomem *p = port->membase; > + u8 old_lcr; > + u8 efr; > + u8 dld; > + > + generic_rs485_config(port, termios, rs485); Shouldn't you check the return value of this function? Yes, today it can't fail, but you don't know that will really be the case, so please fix this. thanks, greg k-h