1 From 5b05462e88dc87d83566d04dd196b4f3d9dc0eef Mon Sep 17 00:00:00 2001
2 From: Fugang Duan <fugang.duan@nxp.com>
3 Date: Mon, 28 Jan 2019 10:12:52 +0800
4 Subject: [PATCH] tty: serial: fsl_lpuart: add modem device reset
6 Add modem device reset, wthether to reset depend on dts configuration.
8 Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
10 drivers/tty/serial/fsl_lpuart.c | 10 ++++++++++
11 1 file changed, 10 insertions(+)
13 --- a/drivers/tty/serial/fsl_lpuart.c
14 +++ b/drivers/tty/serial/fsl_lpuart.c
16 #include <linux/of_dma.h>
17 #include <linux/pm_domain.h>
18 #include <linux/pm_runtime.h>
19 +#include <linux/reset.h>
20 #include <linux/serial_core.h>
21 #include <linux/slab.h>
22 #include <linux/tty_flip.h>
23 @@ -1544,8 +1545,17 @@ static void lpuart32_configure(struct lp
24 static int lpuart32_startup(struct uart_port *port)
26 struct lpuart_port *sport = container_of(port, struct lpuart_port, port);
27 + struct tty_port *tty_port = &sport->port.state->port;
32 + /* some modem may need reset */
33 + if (!tty_port_suspended(tty_port)) {
34 + ret = device_reset(sport->port.dev);
35 + if (ret && ret != -ENOENT)
39 /* determine FIFO size */
40 temp = lpuart32_read(&sport->port, UARTFIFO);