Commit 2fe605df authored by Yuan Yao's avatar Yuan Yao Committed by Greg Kroah-Hartman

serial: fsl-lpuart: disable interrupt when suspend

For power management support, we should disable TX and
TX interrupt so that kernel can prepare for deep sleep.

Retain RX and RX interrupt for wakeup the kernel when
receive the input character.
Signed-off-by: default avatarYuan Yao <yao.yuan@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 011f5bde
...@@ -1846,6 +1846,19 @@ static int lpuart_remove(struct platform_device *pdev) ...@@ -1846,6 +1846,19 @@ static int lpuart_remove(struct platform_device *pdev)
static int lpuart_suspend(struct device *dev) static int lpuart_suspend(struct device *dev)
{ {
struct lpuart_port *sport = dev_get_drvdata(dev); struct lpuart_port *sport = dev_get_drvdata(dev);
unsigned long temp;
if (sport->lpuart32) {
/* disable Rx/Tx and interrupts */
temp = lpuart32_read(sport->port.membase + UARTCTRL);
temp &= ~(UARTCTRL_TE | UARTCTRL_TIE | UARTCTRL_TCIE);
lpuart32_write(temp, sport->port.membase + UARTCTRL);
} else {
/* disable Rx/Tx and interrupts */
temp = readb(sport->port.membase + UARTCR2);
temp &= ~(UARTCR2_TE | UARTCR2_TIE | UARTCR2_TCIE);
writeb(temp, sport->port.membase + UARTCR2);
}
uart_suspend_port(&lpuart_reg, &sport->port); uart_suspend_port(&lpuart_reg, &sport->port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment