lkml.org 
[lkml]   [2020]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register
Hi Roja,

On Thu, Jan 23, 2020 at 06:18:02PM +0530, Roja Rani Yarubandi wrote:

> subject: tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register

Something like 'Support pin swapping' would be more useful.

> Configure UART_IO_MACRO_CTRL register if UART lines are swapped.
>
> Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>
> ---
> drivers/tty/serial/qcom_geni_serial.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index ff63728a95f4..24b862937c1e 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -24,6 +24,7 @@
>
> /* UART specific GENI registers */
> #define SE_UART_LOOPBACK_CFG 0x22c
> +#define SE_UART_IO_MACRO_CTRL 0x240
> #define SE_UART_TX_TRANS_CFG 0x25c
> #define SE_UART_TX_WORD_LEN 0x268
> #define SE_UART_TX_STOP_BIT_LEN 0x26c
> @@ -1260,6 +1261,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
> int irq;
> bool console = false;
> struct uart_driver *drv;
> + u32 val;
>
> if (of_device_is_compatible(pdev->dev.of_node, "qcom,geni-debug-uart"))
> console = true;
> @@ -1309,6 +1311,10 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
> return irq;
> uport->irq = irq;
>
> + ret = of_property_read_u32(pdev->dev.of_node, "qcom,pin_inverse", &val);
> + if (!ret)
> + writel(val, uport->membase + SE_UART_IO_MACRO_CTRL);
> +

Which pins are/can be inversed only RX/TX or also CTS/RTS? If both pairs can be
inversed individually it would be nice to support that.

As Bjorn commented, it's probably better to have boolean properties and keep the
magic values in the driver.

\
 
 \ /
  Last update: 2020-01-23 18:33    [W:0.084 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site