From patchwork Wed Jun 8 11:23:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Govindraj.R" X-Patchwork-Id: 862432 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p58JIajP022592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 8 Jun 2011 19:18:56 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QUGtU-0005oG-Gz; Wed, 08 Jun 2011 11:25:53 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QUGtT-0001WQ-J7; Wed, 08 Jun 2011 11:25:51 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QUGrO-00013B-2o for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2011 11:23:49 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p58BNZqc002853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Jun 2011 06:23:38 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p58BNWY9012610; Wed, 8 Jun 2011 16:53:35 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Wed, 8 Jun 2011 16:53:34 +0530 Received: from localhost.localdomain (omapldc12.india.ti.com [172.24.136.100]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p58BNT7w028360; Wed, 8 Jun 2011 16:53:34 +0530 (IST) From: "Govindraj.R" To: , , Subject: [PATCH v3 11/12] OMAP2: Serial: Add has_async_wake flag. Date: Wed, 8 Jun 2011 16:53:13 +0530 Message-ID: <1307532194-13039-12-git-send-email-govindraj.raja@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1307532194-13039-1-git-send-email-govindraj.raja@ti.com> References: <1307532194-13039-1-git-send-email-govindraj.raja@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110608_072342_504299_7B220102 X-CRM114-Status: GOOD ( 15.44 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.94.94.40 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Tony Lindgren , Kevin Hilman , "Govindraj.R" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 08 Jun 2011 19:18:57 +0000 (UTC) Prior to this patch the uart_clock was cut using prepare/resume calls since these funcs are no more available with runtime changes use has_async_wake flag to keep clock active during bootup otherwise uart port will disabled during boot-up and cannot be enabled back. Also based on this flag we can disable uart port during suspend and enable back during resume for omap_socs that have not set has_async_wake. Signed-off-by: Govindraj.R --- arch/arm/mach-omap2/serial.c | 1 + arch/arm/plat-omap/include/plat/omap-serial.h | 3 +++ drivers/tty/serial/omap-serial.c | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 4bc5914..0a95c95 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -266,6 +266,7 @@ static void omap_uart_idle_init(struct omap_uart_port_info *uart, break; } uart->wk_mask = wk_mask; + uart->has_async_wake = true; } else if (cpu_is_omap24xx()) { u32 wk_mask = 0; u32 wk_en = PM_WKEN1, wk_st = PM_WKST1; diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index b5117bd..69e6d4b 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -79,6 +79,7 @@ struct omap_uart_port_info { void __iomem *wk_st; void __iomem *wk_en; u32 wk_mask; + bool has_async_wake; }; struct uart_omap_dma { @@ -134,6 +135,8 @@ struct uart_omap_port { unsigned int errata; void (*enable_wakeup)(struct platform_device *, bool); bool (*chk_wakeup)(struct platform_device *); + + bool has_async_wake; }; #endif /* __OMAP_SERIAL_H__ */ diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index c3561dd..dbe76f3 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1181,6 +1181,13 @@ static int serial_omap_suspend(struct device *dev) uart_suspend_port(&serial_omap_reg, &up->port); console_trylock(); serial_omap_pm(&up->port, 3, 0); + + /* OMAP2 dont have async wakeup from prcm. + * For such socs clocks will be kept active from probe and + * cut only in suspend path. + */ + if (!up->has_async_wake) + serial_omap_port_disable(up); } return 0; } @@ -1192,6 +1199,9 @@ static int serial_omap_resume(struct device *dev) if (up) { uart_resume_port(&serial_omap_reg, &up->port); console_unlock(); + + if (!up->has_async_wake) + serial_omap_port_enable(up); } return 0; @@ -1415,6 +1425,7 @@ static int serial_omap_probe(struct platform_device *pdev) up->errata = omap_up_info->errata; up->enable_wakeup = omap_up_info->enable_wakeup; up->chk_wakeup = omap_up_info->chk_wakeup; + up->has_async_wake = omap_up_info->has_async_wake; if (omap_up_info->dma_enabled) { up->uart_dma.uart_dma_tx = dma_tx->start; @@ -1443,6 +1454,9 @@ static int serial_omap_probe(struct platform_device *pdev) serial_omap_port_disable(up); } + if (!up->has_async_wake) + serial_omap_port_enable(up); + ui[pdev->id] = up; serial_omap_add_console_port(up);