]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tty: of_serial: add no-loopback-test property
authorGabor Juhos <juhosg@openwrt.org>
Tue, 17 Jul 2012 16:08:31 +0000 (17:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jul 2012 16:16:39 +0000 (09:16 -0700)
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>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/devicetree/bindings/tty/serial/of-serial.txt
drivers/tty/serial/of_serial.c

index 0847fdeee11a5b2961731b97c017df5bf4f4f9ca..ba385f2e0ddc5777daf3f7e9d667e6727ec4c26d 100644 (file)
@@ -25,6 +25,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:
 
index ffc7879e85a4dc9aa09123c82473c06d1300b914..df443b908ca305694c43d9665859c9cca11f3dde 100644 (file)
@@ -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)