summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorFabio Estevam2018-01-04 18:58:34 +0100
committerGreg Kroah-Hartman2018-01-09 16:45:17 +0100
commit38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 (patch)
treee7451467f518dc45182018dbd43e6ec135fa3dea /drivers/tty
parentserial: 8250_uniphier: fix error return code in uniphier_uart_probe() (diff)
downloadkernel-qcow2-linux-38b1f0fb42f772b8c9aac53593883a18ff5eb9d7.tar.gz
kernel-qcow2-linux-38b1f0fb42f772b8c9aac53593883a18ff5eb9d7.tar.xz
kernel-qcow2-linux-38b1f0fb42f772b8c9aac53593883a18ff5eb9d7.zip
serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS
The wakeup mechanism via RTSDEN bit relies on the system using the RTS/CTS lines, so only allow such wakeup method when the system actually has RTS/CTS support. Fixes: bc85734b126f ("serial: imx: allow waking up on RTSD") Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Fugang Duan <fugang.duan@nxp.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index c2b29fd66e8a..7143da39c170 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2225,12 +2225,14 @@ static void serial_imx_enable_wakeup(struct imx_port *sport, bool on)
val &= ~UCR3_AWAKEN;
writel(val, sport->port.membase + UCR3);
- val = readl(sport->port.membase + UCR1);
- if (on)
- val |= UCR1_RTSDEN;
- else
- val &= ~UCR1_RTSDEN;
- writel(val, sport->port.membase + UCR1);
+ if (sport->have_rtscts) {
+ val = readl(sport->port.membase + UCR1);
+ if (on)
+ val |= UCR1_RTSDEN;
+ else
+ val &= ~UCR1_RTSDEN;
+ writel(val, sport->port.membase + UCR1);
+ }
}
static int imx_serial_port_suspend_noirq(struct device *dev)