linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
To: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: nios2-dev-1eJk0qcHJCcaeqlQEoCUNoJY59XmG8rH@public.gmane.org
Subject: [PATCH 5/5 v3] tty: serial: altera_jtaguart: Add device tree support
Date: Fri, 18 Feb 2011 09:10:01 +0100	[thread overview]
Message-ID: <1298016601-19111-1-git-send-email-tklauser@distanz.ch> (raw)
In-Reply-To: <c28550ba11ed228f4137ced1ab34761c08ad38ad.1297974227.git.tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>

Advertise the possibility to use this driver with device tree if
CONFIG_OF is set.

Signed-off-by: Tobias Klauser <tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
---
v3:
 - put device tree binding documentation in the correct place (thanks Grant
   Likely)
v2:
 - add missing semicolon after definition of altera_jtaguart_match

 .../devicetree/bindings/serial/altera_jtaguart.txt |    4 ++++
 drivers/tty/serial/altera_jtaguart.c               |   15 +++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serial/altera_jtaguart.txt

diff --git a/Documentation/devicetree/bindings/serial/altera_jtaguart.txt b/Documentation/devicetree/bindings/serial/altera_jtaguart.txt
new file mode 100644
index 0000000..c152f65
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/altera_jtaguart.txt
@@ -0,0 +1,4 @@
+Altera JTAG UART
+
+Required properties:
+- compatible : should be "ALTR,juart-1.0"
diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index 8f014bb..60e049b 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -466,12 +466,23 @@ static int __devexit altera_jtaguart_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_jtaguart_match[] = {
+	{ .compatible = "ALTR,juart-1.0", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#else
+#define altera_jtaguart_match NULL
+#endif /* CONFIG_OF */
+
 static struct platform_driver altera_jtaguart_platform_driver = {
 	.probe	= altera_jtaguart_probe,
 	.remove	= __devexit_p(altera_jtaguart_remove),
 	.driver	= {
-		.name	= DRV_NAME,
-		.owner	= THIS_MODULE,
+		.name		= DRV_NAME,
+		.owner		= THIS_MODULE,
+		.of_match_table	= altera_jtaguart_match,
 	},
 };
 
-- 
1.7.0.4

  parent reply	other threads:[~2011-02-18  8:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 20:28 [PATCH 0/5] tty: serial: Updates for altera_jtaguart driver Tobias Klauser
2011-02-17 20:28 ` [PATCH 1/5] tty: serial: altera_jtaguart: Don't use plain integer as NULL pointer Tobias Klauser
2011-02-17 20:29 ` [PATCH 2/5] tty: serial: altera_jtaguart: Remove unused function early_altera_jtaguart_setup Tobias Klauser
2011-02-17 20:29 ` [PATCH 3/5] tty: serial: altera_jtaguart: Support getting mapbase and IRQ from resources Tobias Klauser
2011-02-17 20:29 ` [PATCH 4/5] tty: serial: altera_jtaguart: Fixup type usage of port flags Tobias Klauser
2011-02-17 20:30 ` [PATCH 5/5] tty: serial: altera_jtaguart: Add device tree support Tobias Klauser
2011-02-18  7:54   ` [PATCH 5/5 v2] " Tobias Klauser
2011-02-18  7:59     ` Grant Likely
     [not found]   ` <c28550ba11ed228f4137ced1ab34761c08ad38ad.1297974227.git.tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
2011-02-18  8:10     ` Tobias Klauser [this message]
2011-02-28  8:26       ` [PATCH 5/5 v3] " Grant Likely
2011-02-17 22:15 ` [PATCH 0/5] tty: serial: Updates for altera_jtaguart driver Greg KH
2011-02-18  7:23   ` Tobias Klauser
2011-02-18  7:29     ` [Nios2-dev] " Thomas Chou
2011-02-18  7:45       ` Tobias Klauser
2011-02-18  8:06         ` Grant Likely
2011-02-18  8:11           ` Tobias Klauser
2011-02-18 17:20             ` Grant Likely
2011-02-18 15:26         ` Greg KH

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=1298016601-19111-1-git-send-email-tklauser@distanz.ch \
    --to=tklauser-93khv+1bn0nydzi6cay1vq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=gregkh-l3A5Bk7waGM@public.gmane.org \
    --cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nios2-dev-1eJk0qcHJCcaeqlQEoCUNoJY59XmG8rH@public.gmane.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).