[COMMON] serial: samsung: Support in-band-wakeup
authorJung-Ick Guack <ji.guack@samsung.com>
Tue, 14 Jun 2016 09:12:53 +0000 (18:12 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
'in band wakeup' is for enabling wakeup UART_BT
during sleep. CTS or RXD could be wakeup source.
RTS should be Low during sleep.

Change-Id: Ifa683ebad4676ba00513c4a7b699850cdf4c2c50
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
drivers/tty/serial/samsung.c
drivers/tty/serial/samsung.h

index 81b173b5ef6dd637ed98ac0dae2711cc86b6302c..fc3d874c65c1daa6c5f36f11e7e24e2f2bf44f1a 100644 (file)
@@ -756,10 +756,12 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
 
        switch (level) {
        case S3C24XX_UART_PORT_SUSPEND:
-               /* disable auto flow control & set nRTS for High */
-               umcon = rd_regl(port, S3C2410_UMCON);
-               umcon &= ~(S3C2410_UMCOM_AFC | S3C2410_UMCOM_RTS_LOW);
-               wr_regl(port, S3C2410_UMCON, umcon);
+               if (!ourport->in_band_wakeup) {
+                       /* disable auto flow control & set nRTS for High */
+                       umcon = rd_regl(port, S3C2410_UMCON);
+                       umcon &= ~(S3C2410_UMCOM_AFC | S3C2410_UMCOM_RTS_LOW);
+                       wr_regl(port, S3C2410_UMCON, umcon);
+               }
 
                uart_clock_disable(ourport);
                break;
@@ -1620,6 +1622,10 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
                                                PM_QOS_CLUSTER1_FREQ_MIN, 0);
        }
 #endif
+       if (of_get_property(pdev->dev.of_node, "samsung,in-band-wakeup", NULL))
+               ourport->in_band_wakeup = 1;
+       else
+               ourport->in_band_wakeup = 0;
 
        if (of_find_property(pdev->dev.of_node, "samsung,use-default-irq", NULL))
                ourport->use_default_irq =1;
index 789a1187a21861e5de10df995e7e07d0665c4752..401f72ab08020a029a392253877f71180f9a13e8 100644 (file)
@@ -82,6 +82,7 @@ struct s3c24xx_uart_port {
        struct pm_qos_request           s3c24xx_uart_cpu_qos;
        struct delayed_work             qos_work;
 
+       unsigned int                    in_band_wakeup;
        unsigned int dbg_mode;
 };