* [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl @ 2019-10-16 15:18 Philippe Schenker 2019-10-16 15:18 ` [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register Philippe Schenker ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Philippe Schenker @ 2019-10-16 15:18 UTC (permalink / raw) To: Greg Kroah-Hartman, linux-serial Cc: Max Krummenacher, Jiri Slaby, linux-kernel, Fugang Duan, Stefan Agner, linux-imx, Andrey Smirnov, Philippe Schenker Currently flow control is not working due to lpuart32_set_mctrl that is clearing TXCTSE bit in all cases. This bit gets earlier setup by lpuart32_set_termios. As I read in Documentation set_mctrl is also not meant for hardware flow control rather than gpio setting and clearing a RTS signal. Therefore I guess it is safe to remove the whole code in lpuart32_set_mctrl. This was tested with console on a i.MX8QXP SoC. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> --- drivers/tty/serial/fsl_lpuart.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 537896c4d887..f3271857621c 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1333,18 +1333,7 @@ static void lpuart_set_mctrl(struct uart_port *port, unsigned int mctrl) static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl) { - unsigned long temp; - - temp = lpuart32_read(port, UARTMODIR) & - ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); - - if (mctrl & TIOCM_RTS) - temp |= UARTMODIR_RXRTSE; - - if (mctrl & TIOCM_CTS) - temp |= UARTMODIR_TXCTSE; - lpuart32_write(port, temp, UARTMODIR); } static void lpuart_break_ctl(struct uart_port *port, int break_state) -- 2.23.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register 2019-10-16 15:18 [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Philippe Schenker @ 2019-10-16 15:18 ` Philippe Schenker 2019-10-16 20:22 ` Stefan Agner 2019-10-17 5:13 ` [EXT] " Andy Duan 2019-10-16 15:18 ` [PATCH v1 3/3] tty: serial: lpuart: Add RS485 support for 32-bit uart flavour Philippe Schenker 2019-10-17 5:13 ` [EXT] [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Andy Duan 2 siblings, 2 replies; 8+ messages in thread From: Philippe Schenker @ 2019-10-16 15:18 UTC (permalink / raw) To: Greg Kroah-Hartman, linux-serial Cc: Max Krummenacher, Jiri Slaby, linux-kernel, Fugang Duan, Stefan Agner, linux-imx, Andrey Smirnov, Philippe Schenker Use UARTMODIR defines instead of UARTMODEM as it is a 32-bit function Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> --- drivers/tty/serial/fsl_lpuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index f3271857621c..346b4a070ce9 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1879,10 +1879,10 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, } if (termios->c_cflag & CRTSCTS) { - modem |= UARTMODEM_RXRTSE | UARTMODEM_TXCTSE; + modem |= (UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); } else { termios->c_cflag &= ~CRTSCTS; - modem &= ~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE); + modem &= ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); } if (termios->c_cflag & CSTOPB) -- 2.23.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register 2019-10-16 15:18 ` [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register Philippe Schenker @ 2019-10-16 20:22 ` Stefan Agner 2019-10-17 8:09 ` Philippe Schenker 2019-10-17 5:13 ` [EXT] " Andy Duan 1 sibling, 1 reply; 8+ messages in thread From: Stefan Agner @ 2019-10-16 20:22 UTC (permalink / raw) To: Philippe Schenker Cc: Greg Kroah-Hartman, linux-serial, Max Krummenacher, Jiri Slaby, linux-kernel, Fugang Duan, linux-imx, Andrey Smirnov On 2019-10-16 17:18, Philippe Schenker wrote: > Use UARTMODIR defines instead of UARTMODEM as it is a 32-bit function This reads a bit strange at first. Also it is helpful for later to state that this does not make a difference in practise, so how about: Use define from the 32-bit register description UARTMODIR_* instead of UARTMODEM_*. The value is the same, so there is no functional change. Otherwise looks good to me: Reviewed-by: Stefan Agner <stefan.agner@toradex.com> -- Stefan > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> > --- > > drivers/tty/serial/fsl_lpuart.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c > index f3271857621c..346b4a070ce9 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1879,10 +1879,10 @@ lpuart32_set_termios(struct uart_port *port, > struct ktermios *termios, > } > > if (termios->c_cflag & CRTSCTS) { > - modem |= UARTMODEM_RXRTSE | UARTMODEM_TXCTSE; > + modem |= (UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); > } else { > termios->c_cflag &= ~CRTSCTS; > - modem &= ~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE); > + modem &= ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); > } > > if (termios->c_cflag & CSTOPB) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register 2019-10-16 20:22 ` Stefan Agner @ 2019-10-17 8:09 ` Philippe Schenker 0 siblings, 0 replies; 8+ messages in thread From: Philippe Schenker @ 2019-10-17 8:09 UTC (permalink / raw) To: stefan Cc: Max Krummenacher, andrew.smirnov, gregkh, fugang.duan, linux-imx, linux-kernel, linux-serial, jslaby On Wed, 2019-10-16 at 22:22 +0200, Stefan Agner wrote: > On 2019-10-16 17:18, Philippe Schenker wrote: > > Use UARTMODIR defines instead of UARTMODEM as it is a 32-bit > > function > > This reads a bit strange at first. Also it is helpful for later to > state > that this does not make a difference in practise, so how about: > > Use define from the 32-bit register description UARTMODIR_* instead of > UARTMODEM_*. The value is the same, so there is no functional change. > > Otherwise looks good to me: > > Reviewed-by: Stefan Agner <stefan.agner@toradex.com> Thanks for your review and comment. And also thanks to Andy Duan for his reviews! You're right, I could have included that so it is clear that nothing is changed. I will send a v2 today with your suggested commit message Philippe > > -- > Stefan > > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> > > --- > > > > drivers/tty/serial/fsl_lpuart.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/tty/serial/fsl_lpuart.c > > b/drivers/tty/serial/fsl_lpuart.c > > index f3271857621c..346b4a070ce9 100644 > > --- a/drivers/tty/serial/fsl_lpuart.c > > +++ b/drivers/tty/serial/fsl_lpuart.c > > @@ -1879,10 +1879,10 @@ lpuart32_set_termios(struct uart_port *port, > > struct ktermios *termios, > > } > > > > if (termios->c_cflag & CRTSCTS) { > > - modem |= UARTMODEM_RXRTSE | UARTMODEM_TXCTSE; > > + modem |= (UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); > > } else { > > termios->c_cflag &= ~CRTSCTS; > > - modem &= ~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE); > > + modem &= ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); > > } > > > > if (termios->c_cflag & CSTOPB) ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register 2019-10-16 15:18 ` [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register Philippe Schenker 2019-10-16 20:22 ` Stefan Agner @ 2019-10-17 5:13 ` Andy Duan 1 sibling, 0 replies; 8+ messages in thread From: Andy Duan @ 2019-10-17 5:13 UTC (permalink / raw) To: Philippe Schenker, Greg Kroah-Hartman, linux-serial Cc: Max Krummenacher, Jiri Slaby, linux-kernel, Stefan Agner, dl-linux-imx, Andrey Smirnov From: Philippe Schenker <philippe.schenker@toradex.com> Sent: Wednesday, October 16, 2019 11:19 PM > Use UARTMODIR defines instead of UARTMODEM as it is a 32-bit function > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Fugang Duan <fugang.duan@nxp.com> > --- > > drivers/tty/serial/fsl_lpuart.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index > f3271857621c..346b4a070ce9 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1879,10 +1879,10 @@ lpuart32_set_termios(struct uart_port *port, > struct ktermios *termios, > } > > if (termios->c_cflag & CRTSCTS) { > - modem |= UARTMODEM_RXRTSE | > UARTMODEM_TXCTSE; > + modem |= (UARTMODIR_RXRTSE | > UARTMODIR_TXCTSE); > } else { > termios->c_cflag &= ~CRTSCTS; > - modem &= ~(UARTMODEM_RXRTSE | > UARTMODEM_TXCTSE); > + modem &= ~(UARTMODIR_RXRTSE | > UARTMODIR_TXCTSE); > } > > if (termios->c_cflag & CSTOPB) > -- > 2.23.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 3/3] tty: serial: lpuart: Add RS485 support for 32-bit uart flavour 2019-10-16 15:18 [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Philippe Schenker 2019-10-16 15:18 ` [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register Philippe Schenker @ 2019-10-16 15:18 ` Philippe Schenker 2019-10-17 5:14 ` [EXT] " Andy Duan 2019-10-17 5:13 ` [EXT] [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Andy Duan 2 siblings, 1 reply; 8+ messages in thread From: Philippe Schenker @ 2019-10-16 15:18 UTC (permalink / raw) To: Greg Kroah-Hartman, linux-serial Cc: Max Krummenacher, Jiri Slaby, linux-kernel, Fugang Duan, Stefan Agner, linux-imx, Andrey Smirnov, Philippe Schenker This commits adds RS485 support for LPUART hardware that uses 32-bit registers. These are typically found in i.MX8 processors. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> --- drivers/tty/serial/fsl_lpuart.c | 65 ++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 346b4a070ce9..22df5f8f48b6 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1280,6 +1280,57 @@ static int lpuart_config_rs485(struct uart_port *port, return 0; } +static int lpuart32_config_rs485(struct uart_port *port, + struct serial_rs485 *rs485) +{ + struct lpuart_port *sport = container_of(port, + struct lpuart_port, port); + + unsigned long modem = lpuart32_read(&sport->port, UARTMODIR) + & ~(UARTMODEM_TXRTSPOL | UARTMODEM_TXRTSE); + lpuart32_write(&sport->port, modem, UARTMODIR); + + /* clear unsupported configurations */ + rs485->delay_rts_before_send = 0; + rs485->delay_rts_after_send = 0; + rs485->flags &= ~SER_RS485_RX_DURING_TX; + + if (rs485->flags & SER_RS485_ENABLED) { + /* Enable auto RS-485 RTS mode */ + modem |= UARTMODEM_TXRTSE; + + /* + * RTS needs to be logic HIGH either during transer _or_ after + * transfer, other variants are not supported by the hardware. + */ + + if (!(rs485->flags & (SER_RS485_RTS_ON_SEND | + SER_RS485_RTS_AFTER_SEND))) + rs485->flags |= SER_RS485_RTS_ON_SEND; + + if (rs485->flags & SER_RS485_RTS_ON_SEND && + rs485->flags & SER_RS485_RTS_AFTER_SEND) + rs485->flags &= ~SER_RS485_RTS_AFTER_SEND; + + /* + * The hardware defaults to RTS logic HIGH while transfer. + * Switch polarity in case RTS shall be logic HIGH + * after transfer. + * Note: UART is assumed to be active high. + */ + if (rs485->flags & SER_RS485_RTS_ON_SEND) + modem &= ~UARTMODEM_TXRTSPOL; + else if (rs485->flags & SER_RS485_RTS_AFTER_SEND) + modem |= UARTMODEM_TXRTSPOL; + } + + /* Store the new configuration */ + sport->port.rs485 = *rs485; + + lpuart32_write(&sport->port, modem, UARTMODIR); + return 0; +} + static unsigned int lpuart_get_mctrl(struct uart_port *port) { unsigned int temp = 0; @@ -1878,6 +1929,13 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, ctrl |= UARTCTRL_M; } + /* + * When auto RS-485 RTS mode is enabled, + * hardware flow control need to be disabled. + */ + if (sport->port.rs485.flags & SER_RS485_ENABLED) + termios->c_cflag &= ~CRTSCTS; + if (termios->c_cflag & CRTSCTS) { modem |= (UARTMODIR_RXRTSE | UARTMODIR_TXCTSE); } else { @@ -2405,7 +2463,10 @@ static int lpuart_probe(struct platform_device *pdev) sport->port.ops = &lpuart_pops; sport->port.flags = UPF_BOOT_AUTOCONF; - sport->port.rs485_config = lpuart_config_rs485; + if (lpuart_is_32(sport)) + sport->port.rs485_config = lpuart32_config_rs485; + else + sport->port.rs485_config = lpuart_config_rs485; sport->ipg_clk = devm_clk_get(&pdev->dev, "ipg"); if (IS_ERR(sport->ipg_clk)) { @@ -2459,7 +2520,7 @@ static int lpuart_probe(struct platform_device *pdev) sport->port.rs485.delay_rts_after_send) dev_err(&pdev->dev, "driver doesn't support RTS delays\n"); - lpuart_config_rs485(&sport->port, &sport->port.rs485); + sport->port.rs485_config(&sport->port, &sport->port.rs485); sport->dma_tx_chan = dma_request_slave_channel(sport->port.dev, "tx"); if (!sport->dma_tx_chan) -- 2.23.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [EXT] [PATCH v1 3/3] tty: serial: lpuart: Add RS485 support for 32-bit uart flavour 2019-10-16 15:18 ` [PATCH v1 3/3] tty: serial: lpuart: Add RS485 support for 32-bit uart flavour Philippe Schenker @ 2019-10-17 5:14 ` Andy Duan 0 siblings, 0 replies; 8+ messages in thread From: Andy Duan @ 2019-10-17 5:14 UTC (permalink / raw) To: Philippe Schenker, Greg Kroah-Hartman, linux-serial Cc: Max Krummenacher, Jiri Slaby, linux-kernel, Stefan Agner, dl-linux-imx, Andrey Smirnov From: Philippe Schenker <philippe.schenker@toradex.com> Sent: Wednesday, October 16, 2019 11:19 PM > This commits adds RS485 support for LPUART hardware that uses 32-bit > registers. These are typically found in i.MX8 processors. > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Fugang Duan <fugang.duan@nxp.com> > > --- > > drivers/tty/serial/fsl_lpuart.c | 65 ++++++++++++++++++++++++++++++++- > 1 file changed, 63 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index > 346b4a070ce9..22df5f8f48b6 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1280,6 +1280,57 @@ static int lpuart_config_rs485(struct uart_port > *port, > return 0; > } > > +static int lpuart32_config_rs485(struct uart_port *port, > + struct serial_rs485 *rs485) { > + struct lpuart_port *sport = container_of(port, > + struct lpuart_port, port); > + > + unsigned long modem = lpuart32_read(&sport->port, UARTMODIR) > + & ~(UARTMODEM_TXRTSPOL | > UARTMODEM_TXRTSE); > + lpuart32_write(&sport->port, modem, UARTMODIR); > + > + /* clear unsupported configurations */ > + rs485->delay_rts_before_send = 0; > + rs485->delay_rts_after_send = 0; > + rs485->flags &= ~SER_RS485_RX_DURING_TX; > + > + if (rs485->flags & SER_RS485_ENABLED) { > + /* Enable auto RS-485 RTS mode */ > + modem |= UARTMODEM_TXRTSE; > + > + /* > + * RTS needs to be logic HIGH either during transer _or_ > after > + * transfer, other variants are not supported by the > hardware. > + */ > + > + if (!(rs485->flags & (SER_RS485_RTS_ON_SEND | > + SER_RS485_RTS_AFTER_SEND))) > + rs485->flags |= SER_RS485_RTS_ON_SEND; > + > + if (rs485->flags & SER_RS485_RTS_ON_SEND && > + rs485->flags & > SER_RS485_RTS_AFTER_SEND) > + rs485->flags &= > ~SER_RS485_RTS_AFTER_SEND; > + > + /* > + * The hardware defaults to RTS logic HIGH while > transfer. > + * Switch polarity in case RTS shall be logic HIGH > + * after transfer. > + * Note: UART is assumed to be active high. > + */ > + if (rs485->flags & SER_RS485_RTS_ON_SEND) > + modem &= ~UARTMODEM_TXRTSPOL; > + else if (rs485->flags & SER_RS485_RTS_AFTER_SEND) > + modem |= UARTMODEM_TXRTSPOL; > + } > + > + /* Store the new configuration */ > + sport->port.rs485 = *rs485; > + > + lpuart32_write(&sport->port, modem, UARTMODIR); > + return 0; > +} > + > static unsigned int lpuart_get_mctrl(struct uart_port *port) { > unsigned int temp = 0; > @@ -1878,6 +1929,13 @@ lpuart32_set_termios(struct uart_port *port, > struct ktermios *termios, > ctrl |= UARTCTRL_M; > } > > + /* > + * When auto RS-485 RTS mode is enabled, > + * hardware flow control need to be disabled. > + */ > + if (sport->port.rs485.flags & SER_RS485_ENABLED) > + termios->c_cflag &= ~CRTSCTS; > + > if (termios->c_cflag & CRTSCTS) { > modem |= (UARTMODIR_RXRTSE | > UARTMODIR_TXCTSE); > } else { > @@ -2405,7 +2463,10 @@ static int lpuart_probe(struct platform_device > *pdev) > sport->port.ops = &lpuart_pops; > sport->port.flags = UPF_BOOT_AUTOCONF; > > - sport->port.rs485_config = lpuart_config_rs485; > + if (lpuart_is_32(sport)) > + sport->port.rs485_config = lpuart32_config_rs485; > + else > + sport->port.rs485_config = lpuart_config_rs485; > > sport->ipg_clk = devm_clk_get(&pdev->dev, "ipg"); > if (IS_ERR(sport->ipg_clk)) { > @@ -2459,7 +2520,7 @@ static int lpuart_probe(struct platform_device > *pdev) > sport->port.rs485.delay_rts_after_send) > dev_err(&pdev->dev, "driver doesn't support RTS > delays\n"); > > - lpuart_config_rs485(&sport->port, &sport->port.rs485); > + sport->port.rs485_config(&sport->port, &sport->port.rs485); > > sport->dma_tx_chan = > dma_request_slave_channel(sport->port.dev, "tx"); > if (!sport->dma_tx_chan) > -- > 2.23.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl 2019-10-16 15:18 [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Philippe Schenker 2019-10-16 15:18 ` [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register Philippe Schenker 2019-10-16 15:18 ` [PATCH v1 3/3] tty: serial: lpuart: Add RS485 support for 32-bit uart flavour Philippe Schenker @ 2019-10-17 5:13 ` Andy Duan 2 siblings, 0 replies; 8+ messages in thread From: Andy Duan @ 2019-10-17 5:13 UTC (permalink / raw) To: Philippe Schenker, Greg Kroah-Hartman, linux-serial Cc: Max Krummenacher, Jiri Slaby, linux-kernel, Stefan Agner, dl-linux-imx, Andrey Smirnov From: Philippe Schenker <philippe.schenker@toradex.com> Sent: Wednesday, October 16, 2019 11:19 PM > Currently flow control is not working due to lpuart32_set_mctrl that is > clearing TXCTSE bit in all cases. This bit gets earlier setup by > lpuart32_set_termios. > > As I read in Documentation set_mctrl is also not meant for hardware flow > control rather than gpio setting and clearing a RTS signal. > Therefore I guess it is safe to remove the whole code in lpuart32_set_mctrl. > > This was tested with console on a i.MX8QXP SoC. > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Fugang Duan <fugang.duan@nxp.com> > --- > > drivers/tty/serial/fsl_lpuart.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index > 537896c4d887..f3271857621c 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1333,18 +1333,7 @@ static void lpuart_set_mctrl(struct uart_port > *port, unsigned int mctrl) > > static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl) { > - unsigned long temp; > - > - temp = lpuart32_read(port, UARTMODIR) & > - ~(UARTMODIR_RXRTSE | > UARTMODIR_TXCTSE); > - > - if (mctrl & TIOCM_RTS) > - temp |= UARTMODIR_RXRTSE; > - > - if (mctrl & TIOCM_CTS) > - temp |= UARTMODIR_TXCTSE; > > - lpuart32_write(port, temp, UARTMODIR); > } > > static void lpuart_break_ctl(struct uart_port *port, int break_state) > -- > 2.23.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-10-17 8:10 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-10-16 15:18 [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Philippe Schenker 2019-10-16 15:18 ` [PATCH v1 2/3] tty: serial: lpuart: Use defines that correspond to correct register Philippe Schenker 2019-10-16 20:22 ` Stefan Agner 2019-10-17 8:09 ` Philippe Schenker 2019-10-17 5:13 ` [EXT] " Andy Duan 2019-10-16 15:18 ` [PATCH v1 3/3] tty: serial: lpuart: Add RS485 support for 32-bit uart flavour Philippe Schenker 2019-10-17 5:14 ` [EXT] " Andy Duan 2019-10-17 5:13 ` [EXT] [PATCH v1 1/3] tty: serial: lpuart: Remove unnecessary code from set_mctrl Andy Duan
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.