From: Yuan Yao Date: Fri, 23 Jan 2015 09:48:54 +0000 (+0800) Subject: serial: fsl-lpuart: disable interrupt when suspend X-Git-Tag: v4.0-rc1~81^2~56 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=2fe605df325abfa2d36f63469fa960cd40d8cf50;hp=011f5bde62890c39440859c8077a0a5a6aca316d;p=cascardo%2Flinux.git 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: Yuan Yao Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 914f9a2a0157..f196a33e619b 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1846,6 +1846,19 @@ static int lpuart_remove(struct platform_device *pdev) static int lpuart_suspend(struct device *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);