Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281904
b: refs/heads/master
c: ec3bebc
h: refs/heads/master
v: v3
  • Loading branch information
Govindraj.R authored and Kevin Hilman committed Dec 15, 2011
1 parent 5c34195 commit eafe8fb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32212897eeb8c2b2b3c74dbd44d842963084d808
refs/heads/master: ec3bebc6ec64aac23500e6b8ef5c0aaaeda735cf
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <plat/dma.h>
#include <plat/omap_hwmod.h>
#include <plat/omap_device.h>
#include <plat/omap-pm.h>

#include "prm2xxx_3xxx.h"
#include "pm.h"
Expand Down Expand Up @@ -478,6 +479,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
omap_up.dma_enabled = uart->dma_enabled;
omap_up.uartclk = OMAP24XX_BASE_BAUD * 16;
omap_up.flags = UPF_BOOT_AUTOCONF;
omap_up.get_context_loss_count = omap_pm_get_dev_context_loss_count;

pdata = &omap_up;
pdata_size = sizeof(struct omap_uart_port_info);
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/plat-omap/include/plat/omap-serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct omap_uart_port_info {
bool dma_enabled; /* To specify DMA Mode */
unsigned int uartclk; /* UART clock rate */
upf_t flags; /* UPF_* flags */

int (*get_context_loss_count)(struct device *);
};

struct uart_omap_dma {
Expand Down Expand Up @@ -114,6 +116,7 @@ struct uart_omap_port {
unsigned char msr_saved_flags;
char name[20];
unsigned long port_activity;
u32 context_loss_cnt;
};

#endif /* __OMAP_SERIAL_H__ */
20 changes: 18 additions & 2 deletions trunk/drivers/tty/serial/omap-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,15 +1440,31 @@ static void serial_omap_restore_context(struct uart_omap_port *up)
#ifdef CONFIG_PM_RUNTIME
static int serial_omap_runtime_suspend(struct device *dev)
{
struct uart_omap_port *up = dev_get_drvdata(dev);
struct omap_uart_port_info *pdata = dev->platform_data;

if (!up)
return -EINVAL;

if (pdata->get_context_loss_count)
up->context_loss_cnt = pdata->get_context_loss_count(dev);

return 0;
}

static int serial_omap_runtime_resume(struct device *dev)
{
struct uart_omap_port *up = dev_get_drvdata(dev);
struct omap_uart_port_info *pdata = dev->platform_data;

if (up)
serial_omap_restore_context(up);
if (up) {
if (pdata->get_context_loss_count) {
u32 loss_cnt = pdata->get_context_loss_count(dev);

if (up->context_loss_cnt != loss_cnt)
serial_omap_restore_context(up);
}
}

return 0;
}
Expand Down

0 comments on commit eafe8fb

Please sign in to comment.