diff options
author | Fugang Duan <fugang.duan@nxp.com> | 2017-11-09 14:38:32 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:29:03 +0800 |
commit | 0cdb8c073d1d9a7d134ec2ef4f265217c2e25b39 (patch) | |
tree | bec266b091c061cacf49f9b008cf3496cbe5c9f7 /drivers/tty | |
parent | 356230d69153730809205ee6ec33b2eecd520a5b (diff) |
MLK-16789 tty: serial: lpuart: keep ipg clock enable during .uart_resume_port()
Ensure ipg clock enable during .uart_resume_port() that call set
ops->set_mctrl() before ops->startup().
BuildInfo:
- SCFW daf9431c, IMX-MKIMAGE 1c6fc7d8, ATF f2547fb
- U-Boot 2017.03-00097-gd7599cf
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/fsl_lpuart.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 005d461b784b..1be3e38fb29f 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2750,6 +2750,7 @@ static int lpuart_resume(struct device *dev) struct lpuart_port *sport = dev_get_drvdata(dev); struct tty_port *port = &sport->port.state->port; bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq)); + bool ipgclk_on = false; int ret; if (lpuart_is_32(sport)) @@ -2759,15 +2760,17 @@ static int lpuart_resume(struct device *dev) if (uart_console(&sport->port) || (irq_wake && tty_port_initialized(port))) { + ipgclk_on = true; ret = clk_prepare_enable(sport->per_clk); if (ret) return ret; - } else { - clk_disable_unprepare(sport->ipg_clk); } uart_resume_port(&lpuart_reg, &sport->port); + if (!ipgclk_on) + clk_disable_unprepare(sport->ipg_clk); + return 0; } |