]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
serial: of_serial: Handle auto-flow-control property
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Mon, 25 Mar 2013 13:51:15 +0000 (15:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 23:36:48 +0000 (16:36 -0700)
Automatic Flow Control capability is not tied to this
property. This is only one way of detecting it. The property
is limited to be used only with 8250 driver.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/devicetree/bindings/tty/serial/of-serial.txt
drivers/tty/serial/of_serial.c

index c13f0ce74da6ae3131940a2a55aca774628f8e5c..1928a3e83cd0413262de68c036242cb0b92b08fa 100644 (file)
@@ -34,6 +34,9 @@ Optional properties:
 - no-loopback-test: set to indicate that the port does not implements loopback
   test mode
 - fifo-size: the fifo size of the UART.
+- auto-flow-control: one way to enable automatic flow control support. The
+  driver is allowed to detect support for the capability even without this
+  property.
 
 Example:
 
index 267711b5cb4d7f0644577473dfdb002331c3a524..39c7ea4cb14fb9e95fbc920d86010f39db2aa691 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/serial_core.h>
-#include <linux/serial_8250.h>
 #include <linux/serial_reg.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -22,6 +21,8 @@
 #include <linux/nwpserial.h>
 #include <linux/clk.h>
 
+#include "8250/8250.h"
+
 struct of_serial_info {
        struct clk *clk;
        int type;
@@ -171,11 +172,17 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
 #ifdef CONFIG_SERIAL_8250
        case PORT_8250 ... PORT_MAX_8250:
        {
-               /* For now the of bindings don't support the extra
-                  8250 specific bits */
                struct uart_8250_port port8250;
                memset(&port8250, 0, sizeof(port8250));
                port8250.port = port;
+
+               if (port.fifosize)
+                       port8250.capabilities = UART_CAP_FIFO;
+
+               if (of_property_read_bool(ofdev->dev.of_node,
+                                         "auto-flow-control"))
+                       port8250.capabilities |= UART_CAP_AFE;
+
                ret = serial8250_register_8250_port(&port8250);
                break;
        }