linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hkallweit1@gmail.com (Heiner Kallweit)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v2 3/6] serial: meson: remove unneeded variable assignment in meson_serial_port_write
Date: Wed, 19 Apr 2017 22:17:44 +0200	[thread overview]
Message-ID: <ed7c1b5a-342d-fdc4-e362-86cda86c573a@gmail.com> (raw)
In-Reply-To: <4abafe6e-3c7c-049f-d450-ab27e2c7acfd@gmail.com>

There's no need to set AML_UART_TX_EN in each call to
meson_serial_port_write. In addition to meson_uart_startup
set this flag in meson_serial_console_setup and
meson_serial_early_console_setup.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- enable AML_UART_TX_EN in both console setup functions
---
 drivers/tty/serial/meson_uart.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 22857f1e..e93a1e47 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -124,6 +124,15 @@ static void meson_uart_stop_rx(struct uart_port *port)
 	writel(val, port->membase + AML_UART_CONTROL);
 }
 
+static void meson_uart_enable_tx_engine(struct uart_port *port)
+{
+	u32 val;
+
+	val = readl(port->membase + AML_UART_CONTROL);
+	val |= AML_UART_TX_EN;
+	writel(val, port->membase + AML_UART_CONTROL);
+}
+
 static void meson_uart_shutdown(struct uart_port *port)
 {
 	unsigned long flags;
@@ -497,7 +506,6 @@ static void meson_serial_port_write(struct uart_port *port, const char *s,
 	}
 
 	val = readl(port->membase + AML_UART_CONTROL);
-	val |= AML_UART_TX_EN;
 	tmp = val & ~(AML_UART_TX_INT_EN | AML_UART_RX_INT_EN);
 	writel(tmp, port->membase + AML_UART_CONTROL);
 
@@ -536,6 +544,8 @@ static int meson_serial_console_setup(struct console *co, char *options)
 	if (!port || !port->membase)
 		return -ENODEV;
 
+	meson_uart_enable_tx_engine(port);
+
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 
@@ -574,6 +584,7 @@ meson_serial_early_console_setup(struct earlycon_device *device, const char *opt
 	if (!device->port.membase)
 		return -ENODEV;
 
+	meson_uart_enable_tx_engine(&device->port);
 	device->con->write = meson_serial_early_console_write;
 	return 0;
 }
-- 
2.12.2

  parent reply	other threads:[~2017-04-19 20:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 19:59 [PATCH v2 0/6] serial: meson: series with smaller fixes and improvements Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 1/6] serial: meson: fix setting number of stop bits Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 2/6] serial: meson: remove dead code in meson_uart_change_speed Heiner Kallweit
2017-04-19 20:17 ` Heiner Kallweit [this message]
2017-04-19 20:17 ` [PATCH v2 4/6] serial: meson: make use of uart_port member mapsize Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 5/6] serial: meson: remove use of flag UPF_IOREMAP Heiner Kallweit
2017-04-19 20:18 ` [PATCH v2 6/6] serial: meson: change interrupt description to tty name Heiner Kallweit
2017-04-27  6:13   ` Yixun Lan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed7c1b5a-342d-fdc4-e362-86cda86c573a@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=linus-amlogic@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).