From: Govindraj R <govindraj.r...@ti.com>

Ref:
http://git.omapzoom.org/?p=kernel/omap.git;a=commitdiff;h=c74952c3077e4b19e649b5b48c785c01f73ab9d4

Adds context save/restore for mcr register as state of mcr register
is lost after core off.

Cc: Kevin Hilman <khil...@deeprootsystems.com>
Cc: Tero Kristo <tero.kri...@nokia.com>

Signed-off-by: Govindraj R <govindraj.r...@ti.com>
Signed-off-by: Nishanth Menon <n...@ti.com>
---
Note: Original Patch was done for android kernel, was ported and sanity
tested to l-o pm.  A quick check did not reveal any mcr access in
arch/arm/mach-omap2/serial.c though drivers/serial/8250.c seems to
hit on it a lot, hence posting.

 arch/arm/mach-omap2/serial.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index b731556..86d3b47 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -78,6 +78,7 @@ struct omap_uart_state {
        u16 sysc;
        u16 scr;
        u16 wer;
+       u16 mcr;
 #endif
 };
 
@@ -201,6 +202,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;
 }
@@ -229,6 +233,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);
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to