From 26865d3c66b565e9dc56655012649d916bb93c0f Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Mon, 10 Dec 2018 00:00:37 +0100 Subject: tty: serial: imx: fix merge inconsistency Missing commit 688f897ddd96 ("Merge remote-tracking branch 'linux-fslc/4.9-1.0.x-imx' into toradex_4.9-1.0.x-imx-next"). Signed-off-by: Marcel Ziswiler Acked-by: Max Krummenacher --- drivers/tty/serial/imx.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 7b5541695308..ee90d117df57 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1281,13 +1281,6 @@ static int imx_startup(struct uart_port *port) writel(temp & ~UCR4_DREN, sport->port.membase + UCR4); - /* Disable DCDDELT/RIDELT interrupts */ - if (!is_imx1_uart(sport) && sport->dte_mode) { - temp = readl(sport->port.membase + UCR3); - temp &= ~(UCR3_DCD | UCR3_RI); - writel(temp, sport->port.membase + UCR3); - } - /* Reset fifo's and state machines */ i = 100; @@ -2241,6 +2234,18 @@ static int serial_imx_probe(struct platform_device *pdev) clk_disable_unprepare(sport->clk_ipg); + /* if DTE mode is requested, make sure DTE mode is selected + and then disable DCDDELT/RIDELT interrupts */ + if (!is_imx1_uart(sport) && sport->dte_mode) { + unsigned long temp; + temp = readl(sport->port.membase + UFCR); + temp |= UFCR_DCEDTE; + writel(temp, sport->port.membase + UFCR); + temp = readl(sport->port.membase + UCR3); + temp &= ~(UCR3_DCD | UCR3_RI); + writel(temp, sport->port.membase + UCR3); + } + /* * Allocate the IRQ(s) i.MX1 has three interrupts whereas later * chips only have one interrupt. -- cgit v1.2.3