From: Jung-Ick Guack Date: Wed, 20 Jul 2016 06:56:37 +0000 (+0900) Subject: [COMMON] serial: samsung: changed trigger point of disabling UART Tx/Rx mode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0eae78004a2ce68b0d3c87ed3279e064c3eb10c1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] serial: samsung: changed trigger point of disabling UART Tx/Rx mode Change-Id: Ib6aff5d160b011a3064e802a9670aa7dec5286a5 Signed-off-by: Jung-Ick Guack --- diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index c9d19ec90688..337cde7bec95 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -753,9 +753,6 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned int umcon; -#ifdef CONFIG_SERIAL_SAMSUNG_HWACG - unsigned int ucon; -#endif switch (level) { case S3C24XX_UART_PORT_SUSPEND: @@ -766,14 +763,6 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, wr_regl(port, S3C2410_UMCON, umcon); } -#ifdef CONFIG_SERIAL_SAMSUNG_HWACG - /* disable Tx, Rx mode bit for suspend in case of HWACG */ - ucon = rd_regl(port, S3C2410_UCON); - ucon &= ~(S3C2410_UCON_RXIRQMODE | S3C2410_UCON_TXIRQMODE) ; - wr_regl(port, S3C2410_UCON, ucon); - rx_enabled(port) = 0; - tx_enabled(port) = 0; -#endif uart_clock_disable(ourport); break; @@ -1698,9 +1687,20 @@ static int s3c24xx_serial_suspend(struct device *dev) { struct uart_port *port = s3c24xx_dev_to_port(dev); struct s3c24xx_uart_port *ourport = to_ourport(port); +#ifdef CONFIG_SERIAL_SAMSUNG_HWACG + unsigned int ucon; +#endif if (port) { uart_suspend_port(&s3c24xx_uart_drv, port); +#ifdef CONFIG_SERIAL_SAMSUNG_HWACG + /* disable Tx, Rx mode bit for suspend in case of HWACG */ + ucon = rd_regl(port, S3C2410_UCON); + ucon &= ~(S3C2410_UCON_RXIRQMODE | S3C2410_UCON_TXIRQMODE) ; + wr_regl(port, S3C2410_UCON, ucon); + rx_enabled(port) = 0; + tx_enabled(port) = 0; +#endif if (ourport->dbg_mode & UART_DBG_MODE) dev_err(dev, "UART suspend notification for tty framework.\n"); }