mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tty: serial: fsl_lpuart: use UARTMODIR register bits for lpuart32 platform
@ 2023-04-13  5:39 Sherry Sun
  2023-04-13  8:55 ` Ilpo Järvinen
  0 siblings, 1 reply; 3+ messages in thread
From: Sherry Sun @ 2023-04-13  5:39 UTC (permalink / raw)
  To: gregkh, jirislaby, philippe.schenker
  Cc: linux-serial, linux-kernel, linux-imx

For lpuart32 platforms, UARTMODIR register is used instead of UARTMODEM.
So here should configure the corresponding UARTMODIR register bits.

Fixes: 67b01837861c ("tty: serial: lpuart: Add RS485 support for 32-bit uart flavour")
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
---
 drivers/tty/serial/fsl_lpuart.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 074bfed57fc9..9845d3f5b84b 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1406,12 +1406,12 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio
 			struct lpuart_port, port);
 
 	unsigned long modem = lpuart32_read(&sport->port, UARTMODIR)
-				& ~(UARTMODEM_TXRTSPOL | UARTMODEM_TXRTSE);
+				& ~(UARTMODIR_TXRTSPOL | UARTMODIR_TXRTSE);
 	lpuart32_write(&sport->port, modem, UARTMODIR);
 
 	if (rs485->flags & SER_RS485_ENABLED) {
 		/* Enable auto RS-485 RTS mode */
-		modem |= UARTMODEM_TXRTSE;
+		modem |= UARTMODIR_TXRTSE;
 
 		/*
 		 * The hardware defaults to RTS logic HIGH while transfer.
@@ -1420,9 +1420,9 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio
 		 * Note: UART is assumed to be active high.
 		 */
 		if (rs485->flags & SER_RS485_RTS_ON_SEND)
-			modem |= UARTMODEM_TXRTSPOL;
+			modem |= UARTMODIR_TXRTSPOL;
 		else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
-			modem &= ~UARTMODEM_TXRTSPOL;
+			modem &= ~UARTMODIR_TXRTSPOL;
 	}
 
 	lpuart32_write(&sport->port, modem, UARTMODIR);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: serial: fsl_lpuart: use UARTMODIR register bits for lpuart32 platform
  2023-04-13  5:39 [PATCH] tty: serial: fsl_lpuart: use UARTMODIR register bits for lpuart32 platform Sherry Sun
@ 2023-04-13  8:55 ` Ilpo Järvinen
  2023-04-14  1:59   ` Sherry Sun
  0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2023-04-13  8:55 UTC (permalink / raw)
  To: Sherry Sun
  Cc: Greg Kroah-Hartman, Jiri Slaby, philippe.schenker, linux-serial,
	LKML, linux-imx

[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]

On Thu, 13 Apr 2023, Sherry Sun wrote:

> For lpuart32 platforms, UARTMODIR register is used instead of UARTMODEM.
> So here should configure the corresponding UARTMODIR register bits.
> 
> Fixes: 67b01837861c ("tty: serial: lpuart: Add RS485 support for 32-bit uart flavour")

The patch is good but I don't think Fixes tag is warranted here because 
TXRTSPOL and TXRTSE bits are the same for both registers. ...So this 
is mostly to avoid reader confusion rather than fix an actual problem.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.

> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> ---
>  drivers/tty/serial/fsl_lpuart.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
> index 074bfed57fc9..9845d3f5b84b 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -1406,12 +1406,12 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio
>  			struct lpuart_port, port);
>  
>  	unsigned long modem = lpuart32_read(&sport->port, UARTMODIR)
> -				& ~(UARTMODEM_TXRTSPOL | UARTMODEM_TXRTSE);
> +				& ~(UARTMODIR_TXRTSPOL | UARTMODIR_TXRTSE);
>  	lpuart32_write(&sport->port, modem, UARTMODIR);
>  
>  	if (rs485->flags & SER_RS485_ENABLED) {
>  		/* Enable auto RS-485 RTS mode */
> -		modem |= UARTMODEM_TXRTSE;
> +		modem |= UARTMODIR_TXRTSE;
>  
>  		/*
>  		 * The hardware defaults to RTS logic HIGH while transfer.
> @@ -1420,9 +1420,9 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio
>  		 * Note: UART is assumed to be active high.
>  		 */
>  		if (rs485->flags & SER_RS485_RTS_ON_SEND)
> -			modem |= UARTMODEM_TXRTSPOL;
> +			modem |= UARTMODIR_TXRTSPOL;
>  		else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
> -			modem &= ~UARTMODEM_TXRTSPOL;
> +			modem &= ~UARTMODIR_TXRTSPOL;
>  	}
>  
>  	lpuart32_write(&sport->port, modem, UARTMODIR);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] tty: serial: fsl_lpuart: use UARTMODIR register bits for lpuart32 platform
  2023-04-13  8:55 ` Ilpo Järvinen
@ 2023-04-14  1:59   ` Sherry Sun
  0 siblings, 0 replies; 3+ messages in thread
From: Sherry Sun @ 2023-04-14  1:59 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Greg Kroah-Hartman, Jiri Slaby, philippe.schenker, linux-serial,
	LKML, dl-linux-imx



> -----Original Message-----
> From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> Sent: 2023年4月13日 16:56
> To: Sherry Sun <sherry.sun@nxp.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Jiri Slaby
> <jirislaby@kernel.org>; philippe.schenker@toradex.com; linux-serial <linux-
> serial@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>; dl-linux-imx
> <linux-imx@nxp.com>
> Subject: Re: [PATCH] tty: serial: fsl_lpuart: use UARTMODIR register bits for
> lpuart32 platform
> 
> On Thu, 13 Apr 2023, Sherry Sun wrote:
> 
> > For lpuart32 platforms, UARTMODIR register is used instead of
> UARTMODEM.
> > So here should configure the corresponding UARTMODIR register bits.
> >
> > Fixes: 67b01837861c ("tty: serial: lpuart: Add RS485 support for
> > 32-bit uart flavour")
> 
> The patch is good but I don't think Fixes tag is warranted here because
> TXRTSPOL and TXRTSE bits are the same for both registers. ...So this is mostly
> to avoid reader confusion rather than fix an actual problem.
> 
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Sure, will remove the fix tag, thanks.

Best Regards
Sherry

> 
> --
>  i.
> 
> > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > ---
> >  drivers/tty/serial/fsl_lpuart.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/tty/serial/fsl_lpuart.c
> > b/drivers/tty/serial/fsl_lpuart.c index 074bfed57fc9..9845d3f5b84b
> > 100644
> > --- a/drivers/tty/serial/fsl_lpuart.c
> > +++ b/drivers/tty/serial/fsl_lpuart.c
> > @@ -1406,12 +1406,12 @@ static int lpuart32_config_rs485(struct
> uart_port *port, struct ktermios *termio
> >  			struct lpuart_port, port);
> >
> >  	unsigned long modem = lpuart32_read(&sport->port, UARTMODIR)
> > -				& ~(UARTMODEM_TXRTSPOL |
> UARTMODEM_TXRTSE);
> > +				& ~(UARTMODIR_TXRTSPOL |
> UARTMODIR_TXRTSE);
> >  	lpuart32_write(&sport->port, modem, UARTMODIR);
> >
> >  	if (rs485->flags & SER_RS485_ENABLED) {
> >  		/* Enable auto RS-485 RTS mode */
> > -		modem |= UARTMODEM_TXRTSE;
> > +		modem |= UARTMODIR_TXRTSE;
> >
> >  		/*
> >  		 * The hardware defaults to RTS logic HIGH while transfer.
> > @@ -1420,9 +1420,9 @@ static int lpuart32_config_rs485(struct uart_port
> *port, struct ktermios *termio
> >  		 * Note: UART is assumed to be active high.
> >  		 */
> >  		if (rs485->flags & SER_RS485_RTS_ON_SEND)
> > -			modem |= UARTMODEM_TXRTSPOL;
> > +			modem |= UARTMODIR_TXRTSPOL;
> >  		else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
> > -			modem &= ~UARTMODEM_TXRTSPOL;
> > +			modem &= ~UARTMODIR_TXRTSPOL;
> >  	}
> >
> >  	lpuart32_write(&sport->port, modem, UARTMODIR);
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-14  2:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13  5:39 [PATCH] tty: serial: fsl_lpuart: use UARTMODIR register bits for lpuart32 platform Sherry Sun
2023-04-13  8:55 ` Ilpo Järvinen
2023-04-14  1:59   ` Sherry Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®