From patchwork Thu Jul 8 10:08:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 110811 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o68A8DWG009840 for ; Thu, 8 Jul 2010 10:10:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756007Ab0GHKIS (ORCPT ); Thu, 8 Jul 2010 06:08:18 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:64312 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754631Ab0GHKIR (ORCPT ); Thu, 8 Jul 2010 06:08:17 -0400 Received: from muru.com ([72.249.23.125] helo=baageli.muru.com) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1OWo1h-0002YK-7n; Thu, 08 Jul 2010 10:08:17 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 72.249.23.125 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/iRGUzLwHIx3LrqQxhNyj7 Subject: [PATCH 1/5] omap3: serial: Add context save and restore for mcr To: linux-arm-kernel@lists.infradead.org From: Tony Lindgren Cc: Nishanth Menon , Govindraj R , linux-omap@vger.kernel.org Date: Thu, 08 Jul 2010 13:08:12 +0300 Message-ID: <20100708100812.19285.48402.stgit@baageli.muru.com> In-Reply-To: <20100708100715.19285.30066.stgit@baageli.muru.com> References: <20100708100715.19285.30066.stgit@baageli.muru.com> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 08 Jul 2010 10:10:15 +0000 (UTC) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 3771254..804dbb2 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -74,6 +74,7 @@ struct omap_uart_state { u16 sysc; u16 scr; u16 wer; + u16 mcr; #endif }; @@ -197,6 +198,9 @@ static void omap_uart_save_context(struct omap_uart_state *uart) uart->sysc = serial_read_reg(p, UART_OMAP_SYSC); uart->scr = serial_read_reg(p, UART_OMAP_SCR); uart->wer = serial_read_reg(p, UART_OMAP_WER); + serial_write_reg(p, UART_LCR, 0x80); + uart->mcr = serial_read_reg(p, UART_MCR); + serial_write_reg(p, UART_LCR, lcr); uart->context_valid = 1; } @@ -225,6 +229,8 @@ static void omap_uart_restore_context(struct omap_uart_state *uart) serial_write_reg(p, UART_DLM, uart->dlh); serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */ serial_write_reg(p, UART_IER, uart->ier); + serial_write_reg(p, UART_LCR, 0x80); + serial_write_reg(p, UART_MCR, uart->mcr); serial_write_reg(p, UART_FCR, 0xA1); serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */ serial_write_reg(p, UART_EFR, efr);