diff options
author | Vikram Pandita <vikram.pandita@ti.com> | 2011-08-19 15:40:08 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-08-24 11:57:47 -0700 |
commit | c461439981073241065be7ff72610ce1faa2a3bd (patch) | |
tree | 313a2207892b68a3d3c826681167a7ebe4b6d641 | |
parent | 8da1f3b0befaa9f4437f00833cd00f3066afeefc (diff) | |
download | kernel_samsung_tuna-c461439981073241065be7ff72610ce1faa2a3bd.zip kernel_samsung_tuna-c461439981073241065be7ff72610ce1faa2a3bd.tar.gz kernel_samsung_tuna-c461439981073241065be7ff72610ce1faa2a3bd.tar.bz2 |
omap: serial: fix context loss data type and API
data type for context loss count is 'int'
Also the drivers should use the API: omap_pm_get_dev_context_loss_count()
For now this API just returns an up-counting static counter.
In future this API will be fixed to do the right thing.
Change-Id: I0e2121acacb873a08d254fdd2c3b897a4acecab1
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap-serial.h | 2 | ||||
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index 48b788f..20c3e13 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -150,7 +150,7 @@ struct uart_omap_port { char name[20]; unsigned int console_lock; unsigned long port_activity; - u32 context_loss_cnt; + int context_loss_cnt; /* RTS control via driver */ unsigned rts_mux_driver_control:1; unsigned rts_pullup_in_suspend:1; diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 67c7445..dacb936 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -44,6 +44,7 @@ #include <plat/omap-serial.h> #include <plat/omap_device.h> #include <plat/serial.h> +#include <plat/omap-pm.h> static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; @@ -1598,7 +1599,7 @@ static int omap_serial_runtime_suspend(struct device *dev) if (up->rts_mux_driver_control) omap_rts_mux_write(MUX_PULL_UP, up->port.line); - up->context_loss_cnt = omap_device_get_context_loss_count(up->pdev); + up->context_loss_cnt = omap_pm_get_dev_context_loss_count(dev); if (device_may_wakeup(dev)) up->enable_wakeup(up->pdev, true); else @@ -1613,8 +1614,13 @@ static int omap_serial_runtime_resume(struct device *dev) struct omap_device *od; if (up) { - u32 loss_cnt = omap_device_get_context_loss_count(up->pdev); - if (up->context_loss_cnt != loss_cnt) + int loss_cnt = omap_pm_get_dev_context_loss_count(dev); + + /* We don't expect error in this function + * Just in case its an error: + * treat it as force-context-restore */ + if (WARN_ON(loss_cnt < 0) || + (up->context_loss_cnt != loss_cnt)) omap_uart_restore_context(up); if (up->use_dma) { |