diff options
-rw-r--r-- | Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt | 3 | ||||
-rw-r--r-- | drivers/tty/serial/imx.c | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt index b462d0c54823..c662eb36be29 100644 --- a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt +++ b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt | |||
@@ -8,6 +8,8 @@ Required properties: | |||
8 | Optional properties: | 8 | Optional properties: |
9 | - fsl,uart-has-rtscts : Indicate the uart has rts and cts | 9 | - fsl,uart-has-rtscts : Indicate the uart has rts and cts |
10 | - fsl,irda-mode : Indicate the uart supports irda mode | 10 | - fsl,irda-mode : Indicate the uart supports irda mode |
11 | - fsl,dte-mode : Indicate the uart works in DTE mode. The uart works | ||
12 | is DCE mode by default. | ||
11 | 13 | ||
12 | Example: | 14 | Example: |
13 | 15 | ||
@@ -16,4 +18,5 @@ serial@73fbc000 { | |||
16 | reg = <0x73fbc000 0x4000>; | 18 | reg = <0x73fbc000 0x4000>; |
17 | interrupts = <31>; | 19 | interrupts = <31>; |
18 | fsl,uart-has-rtscts; | 20 | fsl,uart-has-rtscts; |
21 | fsl,dte-mode; | ||
19 | }; | 22 | }; |
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index b350cf175940..a07e94f6a9fc 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -201,6 +201,7 @@ struct imx_port { | |||
201 | unsigned int old_status; | 201 | unsigned int old_status; |
202 | int txirq, rxirq, rtsirq; | 202 | int txirq, rxirq, rtsirq; |
203 | unsigned int have_rtscts:1; | 203 | unsigned int have_rtscts:1; |
204 | unsigned int dte_mode:1; | ||
204 | unsigned int use_irda:1; | 205 | unsigned int use_irda:1; |
205 | unsigned int irda_inv_rx:1; | 206 | unsigned int irda_inv_rx:1; |
206 | unsigned int irda_inv_tx:1; | 207 | unsigned int irda_inv_tx:1; |
@@ -1022,6 +1023,8 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1022 | 1023 | ||
1023 | ufcr = readl(sport->port.membase + UFCR); | 1024 | ufcr = readl(sport->port.membase + UFCR); |
1024 | ufcr = (ufcr & (~UFCR_RFDIV)) | UFCR_RFDIV_REG(div); | 1025 | ufcr = (ufcr & (~UFCR_RFDIV)) | UFCR_RFDIV_REG(div); |
1026 | if (sport->dte_mode) | ||
1027 | ufcr |= UFCR_DCEDTE; | ||
1025 | writel(ufcr, sport->port.membase + UFCR); | 1028 | writel(ufcr, sport->port.membase + UFCR); |
1026 | 1029 | ||
1027 | writel(num, sport->port.membase + UBIR); | 1030 | writel(num, sport->port.membase + UBIR); |
@@ -1446,6 +1449,9 @@ static int serial_imx_probe_dt(struct imx_port *sport, | |||
1446 | if (of_get_property(np, "fsl,irda-mode", NULL)) | 1449 | if (of_get_property(np, "fsl,irda-mode", NULL)) |
1447 | sport->use_irda = 1; | 1450 | sport->use_irda = 1; |
1448 | 1451 | ||
1452 | if (of_get_property(np, "fsl,dte-mode", NULL)) | ||
1453 | sport->dte_mode = 1; | ||
1454 | |||
1449 | sport->devdata = of_id->data; | 1455 | sport->devdata = of_id->data; |
1450 | 1456 | ||
1451 | return 0; | 1457 | return 0; |