summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/omap-serial.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-18 16:57:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-18 16:57:53 -0700
commit575a2929815bca197983a22fe6d072534d219be4 (patch)
tree77960b02f5ff4c43c29152119f82658c9bbd0b2d /drivers/tty/serial/omap-serial.c
parent7e55f81ecf592d269b9430d9c06db509fc3f19f9 (diff)
parent12de375ec493ab1767d4a07dde823e63ae5edc21 (diff)
downloadlinux-575a2929815bca197983a22fe6d072534d219be4.tar.bz2
Merge tag 'tty-3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver fixes from Greg KH: "Here are a number of small tty/serial driver fixes for 3.15-rc2. Also in here are some Documentation file removals for drivers that we removed a long time ago, no need to keep it around any longer. All of these have been in linux-next for a bit" * tag 'tty-3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: Revert "serial: 8250, disable "too much work" messages" serial: amba-pl011: fix regression, causing an Oops on rmmod tty: Fix help text of SYNCLINK_CS tty: fix memleak in alloc_pid ttyprintk: Allow built as a module ttyprintk: Fix wrong tty_unregister_driver() call in the error path serial: 8250, disable "too much work" messages Documentation/serial: Delete obsolete driver documentation serial: omap: Fix missing pm_runtime_resume handling by simplifying code serial_core: Fix pm imbalance on unbind serial: pl011: change Rx burst size to half of trigger level serial: timberdale: Depend on X86_32 serial: st-asc: Fix SysRq char handling Revert "serial: clps711x: Give a chance to perform useful tasks during wait loop" serial_core: Fix conditional start_tx on ring buffer not empty serial: efm32: use $vendor,$device scheme for compatible string serial: omap: free the wakeup settings in remove
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r--drivers/tty/serial/omap-serial.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index dd8b1a5458ff..08b6b9419f0d 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -225,14 +225,19 @@ static inline void serial_omap_enable_wakeirq(struct uart_omap_port *up,
if (enable)
enable_irq(up->wakeirq);
else
- disable_irq(up->wakeirq);
+ disable_irq_nosync(up->wakeirq);
}
static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable)
{
struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
+ if (enable == up->wakeups_enabled)
+ return;
+
serial_omap_enable_wakeirq(up, enable);
+ up->wakeups_enabled = enable;
+
if (!pdata || !pdata->enable_wakeup)
return;
@@ -1495,6 +1500,11 @@ static int serial_omap_suspend(struct device *dev)
uart_suspend_port(&serial_omap_reg, &up->port);
flush_work(&up->qos_work);
+ if (device_may_wakeup(dev))
+ serial_omap_enable_wakeup(up, true);
+ else
+ serial_omap_enable_wakeup(up, false);
+
return 0;
}
@@ -1502,6 +1512,9 @@ static int serial_omap_resume(struct device *dev)
{
struct uart_omap_port *up = dev_get_drvdata(dev);
+ if (device_may_wakeup(dev))
+ serial_omap_enable_wakeup(up, false);
+
uart_resume_port(&serial_omap_reg, &up->port);
return 0;
@@ -1789,6 +1802,7 @@ static int serial_omap_remove(struct platform_device *dev)
pm_runtime_disable(up->dev);
uart_remove_one_port(&serial_omap_reg, &up->port);
pm_qos_remove_request(&up->pm_qos_request);
+ device_init_wakeup(&dev->dev, false);
return 0;
}
@@ -1877,17 +1891,7 @@ static int serial_omap_runtime_suspend(struct device *dev)
up->context_loss_cnt = serial_omap_get_context_loss_count(up);
- if (device_may_wakeup(dev)) {
- if (!up->wakeups_enabled) {
- serial_omap_enable_wakeup(up, true);
- up->wakeups_enabled = true;
- }
- } else {
- if (up->wakeups_enabled) {
- serial_omap_enable_wakeup(up, false);
- up->wakeups_enabled = false;
- }
- }
+ serial_omap_enable_wakeup(up, true);
up->latency = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
schedule_work(&up->qos_work);
@@ -1901,6 +1905,8 @@ static int serial_omap_runtime_resume(struct device *dev)
int loss_cnt = serial_omap_get_context_loss_count(up);
+ serial_omap_enable_wakeup(up, false);
+
if (loss_cnt < 0) {
dev_dbg(dev, "serial_omap_get_context_loss_count failed : %d\n",
loss_cnt);