aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/omap-serial.c
diff options
context:
space:
mode:
authorGovindraj.R <govindraj.raja@ti.com>2011-11-07 08:26:12 -0500
committerKevin Hilman <khilman@ti.com>2011-12-14 19:05:21 -0500
commit9f9ac1e84a24670eea1430040e0aef278b4daffa (patch)
treec4ffcf089f95e8232bfff4ac8d7b242408d53057 /drivers/tty/serial/omap-serial.c
parentfcdca75728ac376f3de74376c791e1078ee83820 (diff)
ARM: OMAP2+: UART: Remove context_save and move context restore to driver
Remove context save function from serial.c and move context restore function to omap-serial. Remove all regs stored in omap_uart_state for contex_save/restore, reg read write funcs used in context_save/restore, io_addresses populated for read/write funcs. Clock gating mechanism was done in serial.c and had no info on uart state thus we needed context save and restore in serial.c With runtime conversion and clock gating done within uart driver context restore can be done from regs value available from uart_omap_port structure. Signed-off-by: Govindraj.R <govindraj.raja@ti.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> (for drivers/tty changes) Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r--drivers/tty/serial/omap-serial.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index f16ef4b9363d..a834e913a6e4 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1408,6 +1408,25 @@ static int serial_omap_remove(struct platform_device *dev)
1408 return 0; 1408 return 0;
1409} 1409}
1410 1410
1411static void serial_omap_restore_context(struct uart_omap_port *up)
1412{
1413 serial_out(up, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE);
1414 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); /* Config B mode */
1415 serial_out(up, UART_EFR, UART_EFR_ECB);
1416 serial_out(up, UART_LCR, 0x0); /* Operational mode */
1417 serial_out(up, UART_IER, 0x0);
1418 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); /* Config B mode */
1419 serial_out(up, UART_LCR, 0x0); /* Operational mode */
1420 serial_out(up, UART_IER, up->ier);
1421 serial_out(up, UART_FCR, up->fcr);
1422 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
1423 serial_out(up, UART_MCR, up->mcr);
1424 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); /* Config B mode */
1425 serial_out(up, UART_EFR, up->efr);
1426 serial_out(up, UART_LCR, up->lcr);
1427 serial_out(up, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE);
1428}
1429
1411#ifdef CONFIG_PM_RUNTIME 1430#ifdef CONFIG_PM_RUNTIME
1412static int serial_omap_runtime_suspend(struct device *dev) 1431static int serial_omap_runtime_suspend(struct device *dev)
1413{ 1432{
@@ -1416,6 +1435,11 @@ static int serial_omap_runtime_suspend(struct device *dev)
1416 1435
1417static int serial_omap_runtime_resume(struct device *dev) 1436static int serial_omap_runtime_resume(struct device *dev)
1418{ 1437{
1438 struct uart_omap_port *up = dev_get_drvdata(dev);
1439
1440 if (up)
1441 serial_omap_restore_context(up);
1442
1419 return 0; 1443 return 0;
1420} 1444}
1421#endif 1445#endif