tty: of_serial: add no-loopback-test property

Started by Gabor Juhos on Jul 14, 2012 · 4 messages from 3 authors · Last reply Jul 14, 2012

Subsystems (3)

Maintainers (6)

Show 2 more
STALE5247d

open the first message on its own page

Message details and related content
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 <redacted>
---
 .../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
Message details and related content
On Sat, 14 Jul 2012 14:06:20 +0200
Gabor Juhos [off-list ref] wrote:
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 <redacted>
Looks good to me but clashes with the sync of the termios changes, which
we urgently need to get in first.

Greg - I'll add this to my patch stack with the relevant changes so that
it doesn't get messed up.

Alan
Message details and related content
On Sat, Jul 14, 2012 at 03:01:01PM +0100, Alan Cox wrote:
On Sat, 14 Jul 2012 14:06:20 +0200
Gabor Juhos [off-list ref] wrote:
quoted
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 <redacted>
Looks good to me but clashes with the sync of the termios changes, which
we urgently need to get in first.

Greg - I'll add this to my patch stack with the relevant changes so that
it doesn't get messed up.
Ok, thanks for doing that.

greg k-h
Message details and related content
2012.07.14. 16:01 keltezéssel, Alan Cox írta:
On Sat, 14 Jul 2012 14:06:20 +0200
Gabor Juhos [off-list ref] wrote:
quoted
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 <redacted>
Looks good to me but clashes with the sync of the termios changes, which
we urgently need to get in first.

Greg - I'll add this to my patch stack with the relevant changes so that
it doesn't get messed up.
Thank you!

-Gabor
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help