From: Gabor Juhos <juhosg@openwrt.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Alan Cox <alan@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Landley <rob@landley.net>,
devicetree-discuss@lists.ozlabs.org,
linux-serial@vger.kernel.org, Gabor Juhos <juhosg@openwrt.org>
Subject: [PATCH] tty: of_serial: add no-loopback-test property
Date: Sat, 14 Jul 2012 14:06:20 +0200 [thread overview]
Message-ID: <1342267580-3672-1-git-send-email-juhosg@openwrt.org> (raw)
The loopback test mode is not implemented in all
NS16550 compatible UARTs. The 8250 driver uses the
UPF_SKIP_TEST flag to indicate this, however it is
not possible to set this flag via device-tree.
Add a new 'no-loopback-test' property, and modify
the of_serial driver to set the UPF_SKIP_TEST flag
if the property is present.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
.../devicetree/bindings/tty/serial/of-serial.txt | 2 ++
drivers/tty/serial/of_serial.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
index b8b27b0..0e83e45 100644
--- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
+++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
@@ -24,6 +24,8 @@ Optional properties:
accesses to the UART (e.g. TI davinci).
- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
RTAS and should not be registered.
+- no-loopback-test: set to indicate that the port does not implements loopback
+ test mode
Example:
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 5410c06..301e5e3 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -105,6 +105,10 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
port->uartclk = clk;
port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
| UPF_FIXED_PORT | UPF_FIXED_TYPE;
+
+ if (of_find_property(np, "no-loopback-test", NULL))
+ port->flags |= UPF_SKIP_TEST;
+
port->dev = &ofdev->dev;
if (type == PORT_TEGRA)
--
1.7.2.1
next reply other threads:[~2012-07-14 12:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-14 12:06 Gabor Juhos [this message]
2012-07-14 14:01 ` [PATCH] tty: of_serial: add no-loopback-test property Alan Cox
2012-07-14 14:04 ` Greg Kroah-Hartman
2012-07-14 15:41 ` Gabor Juhos
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=1342267580-3672-1-git-send-email-juhosg@openwrt.org \
--to=juhosg@openwrt.org \
--cc=alan@linux.intel.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
--cc=rob@landley.net \
/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