All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-arm-kernel@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-serial@vger.kernel.org>,
	<jslaby@suse.com>, <davidm@egauge.net>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: [PATCH v2 2/2] serial: atmel: add support for new UART version
Date: Tue, 26 Jan 2016 11:26:15 +0100	[thread overview]
Message-ID: <b50b1f43daba3c78f1f8c4141eb5c3b70a2e37be.1453803763.git.nicolas.ferre@atmel.com> (raw)
In-Reply-To: <198abfa682d5a39758599d34d1c5b9fd2858cedc.1453803763.git.nicolas.ferre@atmel.com>

Starting with sama5d2, the new UART revision has an hardware timer. So, add it
to the IP detection code and set the "has_hw_timer" property for it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reported-by: David Mosberger <davidm@egauge.net>
---
v2: - add needed variable declaration

 drivers/tty/serial/atmel_serial.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index de5d32c31179..a4568b5ffe89 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1710,15 +1710,16 @@ static void atmel_get_ip_name(struct uart_port *port)
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
 	int name = atmel_uart_readl(port, ATMEL_US_NAME);
 	u32 version;
-	u32 usart, dbgu_uart;
+	u32 usart, dbgu_uart, new_uart;
 	/* ASCII decoding for IP version */
 	usart = 0x55534152;	/* USAR(T) */
 	dbgu_uart = 0x44424755;	/* DBGU */
+	new_uart = 0x55415254;	/* UART */
 
 	atmel_port->has_hw_timer = false;
 
-	if (name == usart) {
-		dev_dbg(port->dev, "Usart with hw timer\n");
+	if (name == usart || name == new_uart) {
+		dev_dbg(port->dev, "Usart or uart with hw timer\n");
 		atmel_port->has_hw_timer = true;
 	} else if (name == dbgu_uart) {
 		dev_dbg(port->dev, "Dbgu or uart without hw timer\n");
-- 
2.1.3

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	jslaby@suse.com, davidm@egauge.net,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: [PATCH v2 2/2] serial: atmel: add support for new UART version
Date: Tue, 26 Jan 2016 11:26:15 +0100	[thread overview]
Message-ID: <b50b1f43daba3c78f1f8c4141eb5c3b70a2e37be.1453803763.git.nicolas.ferre@atmel.com> (raw)
In-Reply-To: <198abfa682d5a39758599d34d1c5b9fd2858cedc.1453803763.git.nicolas.ferre@atmel.com>

Starting with sama5d2, the new UART revision has an hardware timer. So, add it
to the IP detection code and set the "has_hw_timer" property for it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reported-by: David Mosberger <davidm@egauge.net>
---
v2: - add needed variable declaration

 drivers/tty/serial/atmel_serial.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index de5d32c31179..a4568b5ffe89 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1710,15 +1710,16 @@ static void atmel_get_ip_name(struct uart_port *port)
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
 	int name = atmel_uart_readl(port, ATMEL_US_NAME);
 	u32 version;
-	u32 usart, dbgu_uart;
+	u32 usart, dbgu_uart, new_uart;
 	/* ASCII decoding for IP version */
 	usart = 0x55534152;	/* USAR(T) */
 	dbgu_uart = 0x44424755;	/* DBGU */
+	new_uart = 0x55415254;	/* UART */
 
 	atmel_port->has_hw_timer = false;
 
-	if (name == usart) {
-		dev_dbg(port->dev, "Usart with hw timer\n");
+	if (name == usart || name == new_uart) {
+		dev_dbg(port->dev, "Usart or uart with hw timer\n");
 		atmel_port->has_hw_timer = true;
 	} else if (name == dbgu_uart) {
 		dev_dbg(port->dev, "Dbgu or uart without hw timer\n");
-- 
2.1.3

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] serial: atmel: add support for new UART version
Date: Tue, 26 Jan 2016 11:26:15 +0100	[thread overview]
Message-ID: <b50b1f43daba3c78f1f8c4141eb5c3b70a2e37be.1453803763.git.nicolas.ferre@atmel.com> (raw)
In-Reply-To: <198abfa682d5a39758599d34d1c5b9fd2858cedc.1453803763.git.nicolas.ferre@atmel.com>

Starting with sama5d2, the new UART revision has an hardware timer. So, add it
to the IP detection code and set the "has_hw_timer" property for it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reported-by: David Mosberger <davidm@egauge.net>
---
v2: - add needed variable declaration

 drivers/tty/serial/atmel_serial.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index de5d32c31179..a4568b5ffe89 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1710,15 +1710,16 @@ static void atmel_get_ip_name(struct uart_port *port)
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
 	int name = atmel_uart_readl(port, ATMEL_US_NAME);
 	u32 version;
-	u32 usart, dbgu_uart;
+	u32 usart, dbgu_uart, new_uart;
 	/* ASCII decoding for IP version */
 	usart = 0x55534152;	/* USAR(T) */
 	dbgu_uart = 0x44424755;	/* DBGU */
+	new_uart = 0x55415254;	/* UART */
 
 	atmel_port->has_hw_timer = false;
 
-	if (name == usart) {
-		dev_dbg(port->dev, "Usart with hw timer\n");
+	if (name == usart || name == new_uart) {
+		dev_dbg(port->dev, "Usart or uart with hw timer\n");
 		atmel_port->has_hw_timer = true;
 	} else if (name == dbgu_uart) {
 		dev_dbg(port->dev, "Dbgu or uart without hw timer\n");
-- 
2.1.3

  reply	other threads:[~2016-01-26 10:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 10:26 [PATCH v2 1/2] serial: atmel: trivial: clean the IP version decoding code Nicolas Ferre
2016-01-26 10:26 ` Nicolas Ferre
2016-01-26 10:26 ` Nicolas Ferre
2016-01-26 10:26 ` Nicolas Ferre [this message]
2016-01-26 10:26   ` [PATCH v2 2/2] serial: atmel: add support for new UART version Nicolas Ferre
2016-01-26 10:26   ` Nicolas Ferre

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=b50b1f43daba3c78f1f8c4141eb5c3b70a2e37be.1453803763.git.nicolas.ferre@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=davidm@egauge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.