Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Huang Shijie and committed by
Greg Kroah-Hartman
20ff2fe6 2cb5a2fa

+9
+3
Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
··· 8 8 Optional properties: 9 9 - fsl,uart-has-rtscts : Indicate the uart has rts and cts 10 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 14 Example: 13 15 ··· 18 16 reg = <0x73fbc000 0x4000>; 19 17 interrupts = <31>; 20 18 fsl,uart-has-rtscts; 19 + fsl,dte-mode; 21 20 };
+6
drivers/tty/serial/imx.c
··· 201 201 unsigned int old_status; 202 202 int txirq, rxirq, rtsirq; 203 203 unsigned int have_rtscts:1; 204 + unsigned int dte_mode:1; 204 205 unsigned int use_irda:1; 205 206 unsigned int irda_inv_rx:1; 206 207 unsigned int irda_inv_tx:1; ··· 1021 1020 1022 1021 ufcr = readl(sport->port.membase + UFCR); 1023 1022 ufcr = (ufcr & (~UFCR_RFDIV)) | UFCR_RFDIV_REG(div); 1023 + if (sport->dte_mode) 1024 + ufcr |= UFCR_DCEDTE; 1024 1025 writel(ufcr, sport->port.membase + UFCR); 1025 1026 1026 1027 writel(num, sport->port.membase + UBIR); ··· 1446 1443 1447 1444 if (of_get_property(np, "fsl,irda-mode", NULL)) 1448 1445 sport->use_irda = 1; 1446 + 1447 + if (of_get_property(np, "fsl,dte-mode", NULL)) 1448 + sport->dte_mode = 1; 1449 1449 1450 1450 sport->devdata = of_id->data; 1451 1451