diff options
author | Huang Shijie <b32955@freescale.com> | 2013-05-30 02:07:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 17:31:39 -0400 |
commit | 20ff2fe60aa86683a68cd369c919ae6a98059c80 (patch) | |
tree | dbca4cbe28cfa92153d6459d33babf088db3d2a5 /drivers | |
parent | 2cb5a2fa219897e5d4ccd8831e8d0f3d6e6f0f23 (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')
-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 72bc1dbcd055..381a2d79593c 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; |
@@ -1020,6 +1021,8 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1020 | 1021 | ||
1021 | ufcr = readl(sport->port.membase + UFCR); | 1022 | ufcr = readl(sport->port.membase + UFCR); |
1022 | ufcr = (ufcr & (~UFCR_RFDIV)) | UFCR_RFDIV_REG(div); | 1023 | ufcr = (ufcr & (~UFCR_RFDIV)) | UFCR_RFDIV_REG(div); |
1024 | if (sport->dte_mode) | ||
1025 | ufcr |= UFCR_DCEDTE; | ||
1023 | writel(ufcr, sport->port.membase + UFCR); | 1026 | writel(ufcr, sport->port.membase + UFCR); |
1024 | 1027 | ||
1025 | writel(num, sport->port.membase + UBIR); | 1028 | writel(num, sport->port.membase + UBIR); |
@@ -1444,6 +1447,9 @@ static int serial_imx_probe_dt(struct imx_port *sport, | |||
1444 | if (of_get_property(np, "fsl,irda-mode", NULL)) | 1447 | if (of_get_property(np, "fsl,irda-mode", NULL)) |
1445 | sport->use_irda = 1; | 1448 | sport->use_irda = 1; |
1446 | 1449 | ||
1450 | if (of_get_property(np, "fsl,dte-mode", NULL)) | ||
1451 | sport->dte_mode = 1; | ||
1452 | |||
1447 | sport->devdata = of_id->data; | 1453 | sport->devdata = of_id->data; |
1448 | 1454 | ||
1449 | return 0; | 1455 | return 0; |