diff options
author | Huang Shijie <b32955@freescale.com> | 2013-05-30 02:07:12 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:00:49 -0400 |
commit | 8c2cb3bfbfb9a1c852b7624656256f159f59b8cd (patch) | |
tree | 4ac74fc824e19da5a161f3b5bcd649373f2cab15 /drivers/tty | |
parent | d86e137f1eccd8cb8a590e11d700a11f6eff08ff (diff) |
serial: imx: add support for DTE mode
The uart works in the DCE mode by default, but sometime we need it
works at the DTE mode.
This patch adds the support for the DTE mode.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/imx.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |