[COMMON] serial: samsung: changed trigger point of disabling UART Tx/Rx mode
authorJung-Ick Guack <ji.guack@samsung.com>
Wed, 20 Jul 2016 06:56:37 +0000 (15:56 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
Change-Id: Ib6aff5d160b011a3064e802a9670aa7dec5286a5
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
drivers/tty/serial/samsung.c

index c9d19ec90688d947100ba302fd742c75fd5b74f5..337cde7bec95bfc5ac4bf0a07fb972aaa75177ad 100644 (file)
@@ -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");
        }