From: Jung-Ick Guack Date: Tue, 14 Jun 2016 09:12:53 +0000 (+0900) Subject: [COMMON] serial: samsung: Support in-band-wakeup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a4cddbce51c5288e579c757397cbfc4c0f294088;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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; };