diff options
Diffstat (limited to 'drivers/tty/serial/of_serial.c')
-rw-r--r-- | drivers/tty/serial/of_serial.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index e8c9cee07d00..5410c0637266 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c | |||
@@ -12,10 +12,13 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/delay.h> | ||
15 | #include <linux/serial_core.h> | 16 | #include <linux/serial_core.h> |
16 | #include <linux/serial_8250.h> | 17 | #include <linux/serial_8250.h> |
18 | #include <linux/serial_reg.h> | ||
17 | #include <linux/of_address.h> | 19 | #include <linux/of_address.h> |
18 | #include <linux/of_irq.h> | 20 | #include <linux/of_irq.h> |
21 | #include <linux/of_serial.h> | ||
19 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
20 | #include <linux/nwpserial.h> | 23 | #include <linux/nwpserial.h> |
21 | 24 | ||
@@ -24,6 +27,26 @@ struct of_serial_info { | |||
24 | int line; | 27 | int line; |
25 | }; | 28 | }; |
26 | 29 | ||
30 | #ifdef CONFIG_ARCH_TEGRA | ||
31 | void tegra_serial_handle_break(struct uart_port *p) | ||
32 | { | ||
33 | unsigned int status, tmout = 10000; | ||
34 | |||
35 | do { | ||
36 | status = p->serial_in(p, UART_LSR); | ||
37 | if (status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS)) | ||
38 | status = p->serial_in(p, UART_RX); | ||
39 | else | ||
40 | break; | ||
41 | if (--tmout == 0) | ||
42 | break; | ||
43 | udelay(1); | ||
44 | } while (1); | ||
45 | } | ||
46 | /* FIXME remove this export when tegra finishes conversion to open firmware */ | ||
47 | EXPORT_SYMBOL_GPL(tegra_serial_handle_break); | ||
48 | #endif | ||
49 | |||
27 | /* | 50 | /* |
28 | * Fill a struct uart_port for a given device node | 51 | * Fill a struct uart_port for a given device node |
29 | */ | 52 | */ |
@@ -84,6 +107,9 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev, | |||
84 | | UPF_FIXED_PORT | UPF_FIXED_TYPE; | 107 | | UPF_FIXED_PORT | UPF_FIXED_TYPE; |
85 | port->dev = &ofdev->dev; | 108 | port->dev = &ofdev->dev; |
86 | 109 | ||
110 | if (type == PORT_TEGRA) | ||
111 | port->handle_break = tegra_serial_handle_break; | ||
112 | |||
87 | return 0; | 113 | return 0; |
88 | } | 114 | } |
89 | 115 | ||