linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty/serial/imx.c: Rename URTX0 to UTXD0
@ 2019-02-22 16:31 Christina Quast
  2019-02-22 20:55 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Christina Quast @ 2019-02-22 16:31 UTC (permalink / raw)
  To: linux-serial; +Cc: gregkh, jslaby, linux-kernel, cquast

Rename to be coherent with the datasheet.

Signed-off-by: Christina Quast <cquast@hanoverdisplays.com>
---
 drivers/tty/serial/imx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index dff75dc94731..a405e0d21ec9 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -40,7 +40,7 @@
 
 /* Register definitions */
 #define URXD0 0x0  /* Receiver Register */
-#define URTX0 0x40 /* Transmitter Register */
+#define UTXD0 0x40 /* Transmitter Register */
 #define UCR1  0x80 /* Control Register 1 */
 #define UCR2  0x84 /* Control Register 2 */
 #define UCR3  0x88 /* Control Register 3 */
@@ -502,7 +502,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport)
 
 	if (sport->port.x_char) {
 		/* Send next char */
-		imx_uart_writel(sport, sport->port.x_char, URTX0);
+		imx_uart_writel(sport, sport->port.x_char, UTXD0);
 		sport->port.icount.tx++;
 		sport->port.x_char = 0;
 		return;
@@ -536,7 +536,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport)
 	       !(imx_uart_readl(sport, imx_uart_uts_reg(sport)) & UTS_TXFULL)) {
 		/* send xmit->buf[xmit->tail]
 		 * out the port here */
-		imx_uart_writel(sport, xmit->buf[xmit->tail], URTX0);
+		imx_uart_writel(sport, xmit->buf[xmit->tail], UTXD0);
 		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
 		sport->port.icount.tx++;
 	}
@@ -1257,7 +1257,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
 	}
 
 	slave_config.direction = DMA_MEM_TO_DEV;
-	slave_config.dst_addr = sport->port.mapbase + URTX0;
+	slave_config.dst_addr = sport->port.mapbase + UTXD0;
 	slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
 	slave_config.dst_maxburst = TXTL_DMA;
 	ret = dmaengine_slave_config(sport->dma_chan_tx, &slave_config);
@@ -1812,7 +1812,7 @@ static void imx_uart_poll_put_char(struct uart_port *port, unsigned char c)
 	} while (~status & USR1_TRDY);
 
 	/* write */
-	imx_uart_writel(sport, c, URTX0);
+	imx_uart_writel(sport, c, UTXD0);
 
 	/* flush */
 	do {
@@ -1894,7 +1894,7 @@ static void imx_uart_console_putchar(struct uart_port *port, int ch)
 	while (imx_uart_readl(sport, imx_uart_uts_reg(sport)) & UTS_TXFULL)
 		barrier();
 
-	imx_uart_writel(sport, ch, URTX0);
+	imx_uart_writel(sport, ch, UTXD0);
 }
 
 /*
@@ -2091,7 +2091,7 @@ static void imx_uart_console_early_putchar(struct uart_port *port, int ch)
 	while (imx_uart_readl(sport, IMX21_UTS) & UTS_TXFULL)
 		cpu_relax();
 
-	imx_uart_writel(sport, ch, URTX0);
+	imx_uart_writel(sport, ch, UTXD0);
 }
 
 static void imx_uart_console_early_write(struct console *con, const char *s,
-- 
2.20.1




 
Please consider the environment before printing this email
 

 
 
 
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender or postmaster (postmaster@hanoverdisplays.com) and delete the material from any computer.
Although we routinely screen for viruses, addressees should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments.
Our Company's email policy is to permit incidental personal use. If this email is of a personal nature, it must not be relied upon as expressing the views or opinions of the company.


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

* Re: [PATCH] tty/serial/imx.c: Rename URTX0 to UTXD0
  2019-02-22 16:31 [PATCH] tty/serial/imx.c: Rename URTX0 to UTXD0 Christina Quast
@ 2019-02-22 20:55 ` Uwe Kleine-König
  2019-03-05 11:45   ` [PATCH v2] serial: imx: Rename URTX0 to UTXD, URXD0 to URXD Christina Quast
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2019-02-22 20:55 UTC (permalink / raw)
  To: Christina Quast; +Cc: linux-serial, gregkh, jslaby, linux-kernel, kernel

On Fri, Feb 22, 2019 at 04:31:27PM +0000, Christina Quast wrote:
> Rename to be coherent with the datasheet.
> 
> Signed-off-by: Christina Quast <cquast@hanoverdisplays.com>
> ---
>  drivers/tty/serial/imx.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index dff75dc94731..a405e0d21ec9 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -40,7 +40,7 @@
>  
>  /* Register definitions */
>  #define URXD0 0x0  /* Receiver Register */
> -#define URTX0 0x40 /* Transmitter Register */
> +#define UTXD0 0x40 /* Transmitter Register */

Oh wow, I never noticed this and it was wrong ever since the kernel is
tracked in git (back in 1da177e4c3f4 the definition was in
include/asm-arm/arch-imx/imx-regs.h)---I didn't check further.

Also I checked the i.MX1, i.MX25 and i.MX6 manuals and the transmit
register was never called RTX, in all three manuals it is named UTXD.

I suggest to also drop the 0 from both URXD0 and UTXD0.

If you send a v2 I recommend adding the imx people (from MAINTAINERS) to
Cc.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH v2] serial: imx: Rename URTX0 to UTXD, URXD0 to URXD
  2019-02-22 20:55 ` Uwe Kleine-König
@ 2019-03-05 11:45   ` Christina Quast
  0 siblings, 0 replies; 3+ messages in thread
From: Christina Quast @ 2019-03-05 11:45 UTC (permalink / raw)
  Cc: shawnguo, s.hauer, u.kleine-koenig, Christina Quast,
	Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel

Rename to be coherent with the datasheet.

Signed-off-by: Christina Quast <cquast@hanoverdisplays.com>
---
 drivers/tty/serial/imx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index dff75dc94731..8edb368690d9 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -39,8 +39,8 @@
 #include "serial_mctrl_gpio.h"
 
 /* Register definitions */
-#define URXD0 0x0  /* Receiver Register */
-#define URTX0 0x40 /* Transmitter Register */
+#define URXD 0x0  /* Receiver Register */
+#define UTXD 0x40 /* Transmitter Register */
 #define UCR1  0x80 /* Control Register 1 */
 #define UCR2  0x84 /* Control Register 2 */
 #define UCR3  0x88 /* Control Register 3 */
@@ -502,7 +502,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport)
 
 	if (sport->port.x_char) {
 		/* Send next char */
-		imx_uart_writel(sport, sport->port.x_char, URTX0);
+		imx_uart_writel(sport, sport->port.x_char, UTXD);
 		sport->port.icount.tx++;
 		sport->port.x_char = 0;
 		return;
@@ -536,7 +536,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport)
 	       !(imx_uart_readl(sport, imx_uart_uts_reg(sport)) & UTS_TXFULL)) {
 		/* send xmit->buf[xmit->tail]
 		 * out the port here */
-		imx_uart_writel(sport, xmit->buf[xmit->tail], URTX0);
+		imx_uart_writel(sport, xmit->buf[xmit->tail], UTXD);
 		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
 		sport->port.icount.tx++;
 	}
@@ -743,7 +743,7 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id)
 		flg = TTY_NORMAL;
 		sport->port.icount.rx++;
 
-		rx = imx_uart_readl(sport, URXD0);
+		rx = imx_uart_readl(sport, URXD);
 
 		usr2 = imx_uart_readl(sport, USR2);
 		if (usr2 & USR2_BRCD) {
@@ -870,7 +870,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id)
 	 * the respective irq source is enabled. This prevents some undesired
 	 * actions, for example if a character that sits in the RX FIFO and that
 	 * should be fetched via DMA is tried to be fetched using PIO. Or the
-	 * receiver is currently off and so reading from URXD0 results in an
+	 * receiver is currently off and so reading from URXD results in an
 	 * exception. So just mask the (raw) status bits for disabled irqs.
 	 */
 	if ((ucr1 & UCR1_RRDYEN) == 0)
@@ -1231,7 +1231,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
 	}
 
 	slave_config.direction = DMA_DEV_TO_MEM;
-	slave_config.src_addr = sport->port.mapbase + URXD0;
+	slave_config.src_addr = sport->port.mapbase + URXD;
 	slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
 	/* one byte less than the watermark level to enable the aging timer */
 	slave_config.src_maxburst = RXTL_DMA - 1;
@@ -1257,7 +1257,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
 	}
 
 	slave_config.direction = DMA_MEM_TO_DEV;
-	slave_config.dst_addr = sport->port.mapbase + URTX0;
+	slave_config.dst_addr = sport->port.mapbase + UTXD;
 	slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
 	slave_config.dst_maxburst = TXTL_DMA;
 	ret = dmaengine_slave_config(sport->dma_chan_tx, &slave_config);
@@ -1798,7 +1798,7 @@ static int imx_uart_poll_get_char(struct uart_port *port)
 	if (!(imx_uart_readl(sport, USR2) & USR2_RDR))
 		return NO_POLL_CHAR;
 
-	return imx_uart_readl(sport, URXD0) & URXD_RX_DATA;
+	return imx_uart_readl(sport, URXD) & URXD_RX_DATA;
 }
 
 static void imx_uart_poll_put_char(struct uart_port *port, unsigned char c)
@@ -1812,7 +1812,7 @@ static void imx_uart_poll_put_char(struct uart_port *port, unsigned char c)
 	} while (~status & USR1_TRDY);
 
 	/* write */
-	imx_uart_writel(sport, c, URTX0);
+	imx_uart_writel(sport, c, UTXD);
 
 	/* flush */
 	do {
@@ -1894,7 +1894,7 @@ static void imx_uart_console_putchar(struct uart_port *port, int ch)
 	while (imx_uart_readl(sport, imx_uart_uts_reg(sport)) & UTS_TXFULL)
 		barrier();
 
-	imx_uart_writel(sport, ch, URTX0);
+	imx_uart_writel(sport, ch, UTXD);
 }
 
 /*
@@ -2091,7 +2091,7 @@ static void imx_uart_console_early_putchar(struct uart_port *port, int ch)
 	while (imx_uart_readl(sport, IMX21_UTS) & UTS_TXFULL)
 		cpu_relax();
 
-	imx_uart_writel(sport, ch, URTX0);
+	imx_uart_writel(sport, ch, UTXD);
 }
 
 static void imx_uart_console_early_write(struct console *con, const char *s,
-- 
2.20.1




 
Please consider the environment before printing this email
 

 
 
 
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender or postmaster (postmaster@hanoverdisplays.com) and delete the material from any computer.
Although we routinely screen for viruses, addressees should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments.
Our Company's email policy is to permit incidental personal use. If this email is of a personal nature, it must not be relied upon as expressing the views or opinions of the company.


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

end of thread, other threads:[~2019-03-05 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 16:31 [PATCH] tty/serial/imx.c: Rename URTX0 to UTXD0 Christina Quast
2019-02-22 20:55 ` Uwe Kleine-König
2019-03-05 11:45   ` [PATCH v2] serial: imx: Rename URTX0 to UTXD, URXD0 to URXD Christina Quast

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).