Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register
@ 2020-01-23 12:48 Roja Rani Yarubandi
  2020-01-23 12:48 ` [PATCH v2 1/1] " Roja Rani Yarubandi
  0 siblings, 1 reply; 5+ messages in thread
From: Roja Rani Yarubandi @ 2020-01-23 12:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: akashast, msavaliy, mgautam, skakit, Andy Gross, Bjorn Andersson,
	Jiri Slaby, linux-arm-msm, linux-serial, linux-kernel,
	Roja Rani Yarubandi

Configure UART_IO_MACRO_CTRL register if UART lines are swapped.

Roja Rani Yarubandi (1):
  tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register

 drivers/tty/serial/qcom_geni_serial.c | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of the Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH v2 1/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register
  2020-01-23 12:48 [PATCH v2 0/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register Roja Rani Yarubandi
@ 2020-01-23 12:48 ` " Roja Rani Yarubandi
  2020-01-23 13:44   ` Greg Kroah-Hartman
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Roja Rani Yarubandi @ 2020-01-23 12:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: akashast, msavaliy, mgautam, skakit, Andy Gross, Bjorn Andersson,
	Jiri Slaby, linux-arm-msm, linux-serial, linux-kernel,
	Roja Rani Yarubandi

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);
+
 	irq_set_status_flags(uport->irq, IRQ_NOAUTOEN);
 	ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr,
 			IRQF_TRIGGER_HIGH, port->name, uport);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of the Code Aurora Forum, hosted by The Linux Foundation


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

* Re: [PATCH v2 1/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register
  2020-01-23 12:48 ` [PATCH v2 1/1] " Roja Rani Yarubandi
@ 2020-01-23 13:44   ` Greg Kroah-Hartman
  2020-01-23 16:08   ` Bjorn Andersson
  2020-01-23 17:32   ` Matthias Kaehlcke
  2 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-23 13:44 UTC (permalink / raw)
  To: Roja Rani Yarubandi
  Cc: akashast, msavaliy, mgautam, skakit, Andy Gross, Bjorn Andersson,
	Jiri Slaby, linux-arm-msm, linux-serial, linux-kernel

On Thu, Jan 23, 2020 at 06:18:02PM +0530, Roja Rani Yarubandi wrote:
> 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(+)

What changed from v1?  Always put that below the --- line.

And no need for a 0/1 email for a single patch, just put everything in
the patch changelog itself as it is standalone.

thanks,

greg k-h

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

* Re: [PATCH v2 1/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register
  2020-01-23 12:48 ` [PATCH v2 1/1] " Roja Rani Yarubandi
  2020-01-23 13:44   ` Greg Kroah-Hartman
@ 2020-01-23 16:08   ` Bjorn Andersson
  2020-01-23 17:32   ` Matthias Kaehlcke
  2 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2020-01-23 16:08 UTC (permalink / raw)
  To: Roja Rani Yarubandi
  Cc: Greg Kroah-Hartman, akashast, msavaliy, mgautam, skakit,
	Andy Gross, Jiri Slaby, linux-arm-msm, linux-serial,
	linux-kernel

On Thu 23 Jan 04:48 PST 2020, Roja Rani Yarubandi wrote:

> 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);

This needs to be documented in the DT binding document. And I assume
it's better suited as a bool property to be read using
of_property_read_bool().

Also avoid '_' in property names and make it a '-'.

Regards,
Bjorn

> +	if (!ret)
> +		writel(val, uport->membase + SE_UART_IO_MACRO_CTRL);
> +
>  	irq_set_status_flags(uport->irq, IRQ_NOAUTOEN);
>  	ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr,
>  			IRQF_TRIGGER_HIGH, port->name, uport);
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of the Code Aurora Forum, hosted by The Linux Foundation
> 

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

* Re: [PATCH v2 1/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register
  2020-01-23 12:48 ` [PATCH v2 1/1] " Roja Rani Yarubandi
  2020-01-23 13:44   ` Greg Kroah-Hartman
  2020-01-23 16:08   ` Bjorn Andersson
@ 2020-01-23 17:32   ` Matthias Kaehlcke
  2 siblings, 0 replies; 5+ messages in thread
From: Matthias Kaehlcke @ 2020-01-23 17:32 UTC (permalink / raw)
  To: Roja Rani Yarubandi
  Cc: Greg Kroah-Hartman, akashast, msavaliy, mgautam, skakit,
	Andy Gross, Bjorn Andersson, Jiri Slaby, linux-arm-msm,
	linux-serial, linux-kernel, Douglas Anderson

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.

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 12:48 [PATCH v2 0/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register Roja Rani Yarubandi
2020-01-23 12:48 ` [PATCH v2 1/1] " Roja Rani Yarubandi
2020-01-23 13:44   ` Greg Kroah-Hartman
2020-01-23 16:08   ` Bjorn Andersson
2020-01-23 17:32   ` Matthias Kaehlcke

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git