[PATCH v3 10/11] serial: sc16is7xx: add call to get rs485 DT flags and properties

Hugo Villeneuve posted 11 patches 2 years, 8 months ago
There is a newer version of this series
[PATCH v3 10/11] serial: sc16is7xx: add call to get rs485 DT flags and properties
Posted by Hugo Villeneuve 2 years, 8 months ago
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Add call to uart_get_rs485_mode() to probe for RS485 flags and
properties from device tree.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/tty/serial/sc16is7xx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index c2cfd057ed9a..03d00b144304 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1511,6 +1511,10 @@ static int sc16is7xx_probe(struct device *dev,
 			goto out_ports;
 		}
 
+		ret = uart_get_rs485_mode(&s->p[i].port);
+		if (ret)
+			goto out_ports;
+
 		/* Disable all interrupts */
 		sc16is7xx_port_write(&s->p[i].port, SC16IS7XX_IER_REG, 0);
 		/* Disable TX/RX */
-- 
2.30.2
Re: [PATCH v3 10/11] serial: sc16is7xx: add call to get rs485 DT flags and properties
Posted by Ilpo Järvinen 2 years, 8 months ago
On Thu, 25 May 2023, Hugo Villeneuve wrote:

> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> Add call to uart_get_rs485_mode() to probe for RS485 flags and
> properties from device tree.
> 
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> ---
>  drivers/tty/serial/sc16is7xx.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index c2cfd057ed9a..03d00b144304 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -1511,6 +1511,10 @@ static int sc16is7xx_probe(struct device *dev,
>  			goto out_ports;
>  		}
>  
> +		ret = uart_get_rs485_mode(&s->p[i].port);
> +		if (ret)
> +			goto out_ports;
> +
>  		/* Disable all interrupts */
>  		sc16is7xx_port_write(&s->p[i].port, SC16IS7XX_IER_REG, 0);
>  		/* Disable TX/RX */
> 

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

-- 
 i.