aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2013-03-25 09:51:15 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 19:36:48 -0400
commitb0b8c84cf58d2486d48f486b5c47af7a7a33a497 (patch)
tree6ac36520e3535d9bac0bb1bf20a2945e5879d471
parent44a459fd83376d08b0dea776354761ebb1bacde1 (diff)
serial: of_serial: Handle auto-flow-control property
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>
-rw-r--r--Documentation/devicetree/bindings/tty/serial/of-serial.txt3
-rw-r--r--drivers/tty/serial/of_serial.c13
2 files changed, 13 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
index c13f0ce74da6..1928a3e83cd0 100644
--- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
+++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
@@ -34,6 +34,9 @@ Optional properties:
34- no-loopback-test: set to indicate that the port does not implements loopback 34- no-loopback-test: set to indicate that the port does not implements loopback
35 test mode 35 test mode
36- fifo-size: the fifo size of the UART. 36- fifo-size: the fifo size of the UART.
37- auto-flow-control: one way to enable automatic flow control support. The
38 driver is allowed to detect support for the capability even without this
39 property.
37 40
38Example: 41Example:
39 42
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 267711b5cb4d..39c7ea4cb14f 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -14,7 +14,6 @@
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/serial_core.h> 16#include <linux/serial_core.h>
17#include <linux/serial_8250.h>
18#include <linux/serial_reg.h> 17#include <linux/serial_reg.h>
19#include <linux/of_address.h> 18#include <linux/of_address.h>
20#include <linux/of_irq.h> 19#include <linux/of_irq.h>
@@ -22,6 +21,8 @@
22#include <linux/nwpserial.h> 21#include <linux/nwpserial.h>
23#include <linux/clk.h> 22#include <linux/clk.h>
24 23
24#include "8250/8250.h"
25
25struct of_serial_info { 26struct of_serial_info {
26 struct clk *clk; 27 struct clk *clk;
27 int type; 28 int type;
@@ -171,11 +172,17 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
171#ifdef CONFIG_SERIAL_8250 172#ifdef CONFIG_SERIAL_8250
172 case PORT_8250 ... PORT_MAX_8250: 173 case PORT_8250 ... PORT_MAX_8250:
173 { 174 {
174 /* For now the of bindings don't support the extra
175 8250 specific bits */
176 struct uart_8250_port port8250; 175 struct uart_8250_port port8250;
177 memset(&port8250, 0, sizeof(port8250)); 176 memset(&port8250, 0, sizeof(port8250));
178 port8250.port = port; 177 port8250.port = port;
178
179 if (port.fifosize)
180 port8250.capabilities = UART_CAP_FIFO;
181
182 if (of_property_read_bool(ofdev->dev.of_node,
183 "auto-flow-control"))
184 port8250.capabilities |= UART_CAP_AFE;
185
179 ret = serial8250_register_8250_port(&port8250); 186 ret = serial8250_register_8250_port(&port8250);
180 break; 187 break;
181 } 188 }