summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Zobel <dzobel1@motorola.com>2014-08-28 11:48:00 -0500
committerDoug Zobel <dzobel1@motorola.com>2014-08-28 16:29:39 -0500
commit71c0f1a08b1b65e92f984b226d2791c3c3190a29 (patch)
tree9547109edc552f0ca1e72f1ee24b0b00ff1b3338
parenta1ac4d40cc3bc8cc91f78272d5669bee92f1286f (diff)
downloadolio-linux-3.10-71c0f1a08b1b65e92f984b226d2791c3c3190a29.tar.xz
olio-linux-3.10-71c0f1a08b1b65e92f984b226d2791c3c3190a29.zip
IKXCLOCK-3681 omap: uart: Leave RTS in blocking state until resume has completed
If runtime suspend is enabled before the kernel has completed resume, then the UART may not be ready to recieve data. To avoid this, RTS line will be held in the block mode until kernel resume has completed. Change-Id: Ia7dc635788c50ec150bbf65d5602f66a7a69bf5c
-rw-r--r--drivers/tty/serial/omap-serial.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 8ec43253e64..e637567b40b 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -172,6 +172,7 @@ struct uart_omap_port {
struct pinctrl_state *pin_default;
struct pinctrl_state *pin_idle;
bool is_suspending;
+ bool need_delayed_rts;
bool in_transmit;
int ext_rt_cnt;
bool open_close_pm;
@@ -1389,6 +1390,10 @@ static int serial_omap_resume(struct device *dev)
struct uart_omap_port *up = dev_get_drvdata(dev);
uart_resume_port(&serial_omap_reg, &up->port);
+ if (up->need_delayed_rts && up->pin_default && up->pin_idle) {
+ pinctrl_select_state(up->pins, up->pin_default);
+ up->need_delayed_rts = 0;
+ }
return 0;
}
@@ -1756,8 +1761,10 @@ static int serial_omap_runtime_suspend(struct device *dev)
if (!up)
return -EINVAL;
- if (up->pin_idle)
+ if (up->pin_idle) {
pinctrl_select_state(up->pins, up->pin_idle);
+ up->need_delayed_rts = 0;
+ }
up->context_loss_cnt = serial_omap_get_context_loss_count(up);
if (device_may_wakeup(dev)) {
@@ -1787,8 +1794,12 @@ static int serial_omap_runtime_resume(struct device *dev)
}
up->latency = up->calc_latency;
serial_omap_uart_qos(up);
- if (up->pin_default && up->pin_idle)
- pinctrl_select_state(up->pins, up->pin_default);
+ if (up->pin_default && up->pin_idle) {
+ if (up->is_suspending)
+ up->need_delayed_rts = 1;
+ else
+ pinctrl_select_state(up->pins, up->pin_default);
+ }
return 0;
}