]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/blobdiff - drivers/tty/serial/of_serial.c
Merge tag 'v3.10' into master-next
[vajnamar/linux-xlnx.git] / drivers / tty / serial / of_serial.c
index 0c9144f9ce1e6718bc265e669b567a909e8482db..26553d26a1d6e58a97ab331a28917f75e9ac4cd6 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;
@@ -97,6 +98,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
        if (of_property_read_u32(np, "reg-shift", &prop) == 0)
                port->regshift = prop;
 
+       /* Check for fifo size */
+       if (of_property_read_u32(np, "fifo-size", &prop) == 0)
+               port->fifosize = prop;
+
        port->irq = irq_of_parse_and_map(np, 0);
        port->iotype = UPIO_MEM;
        if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
@@ -182,11 +187,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;
        }