From a4cddbce51c5288e579c757397cbfc4c0f294088 Mon Sep 17 00:00:00 2001 From: Jung-Ick Guack Date: Tue, 14 Jun 2016 18:12:53 +0900 Subject: [PATCH] [COMMON] serial: samsung: Support in-band-wakeup '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 --- drivers/tty/serial/samsung.c | 14 ++++++++++---- drivers/tty/serial/samsung.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 81b173b5ef6d..fc3d874c65c1 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -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; diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h index 789a1187a218..401f72ab0802 100644 --- a/drivers/tty/serial/samsung.h +++ b/drivers/tty/serial/samsung.h @@ -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; }; -- 2.20.1