summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorJon Hunter2012-06-05 19:34:55 +0200
committerTony Lindgren2012-06-14 11:39:47 +0200
commit1c2d076b589225e51e022d85bb9f25dca26530f3 (patch)
treede3e16c873c844a8529fe596aae9c8e2235282c3 /arch/arm/plat-omap
parentARM: OMAP2+: Fix external clock support for dmtimers (diff)
downloadkernel-qcow2-linux-1c2d076b589225e51e022d85bb9f25dca26530f3.tar.gz
kernel-qcow2-linux-1c2d076b589225e51e022d85bb9f25dca26530f3.tar.xz
kernel-qcow2-linux-1c2d076b589225e51e022d85bb9f25dca26530f3.zip
ARM: OMAP: Remove loses_context variable from timer platform data
The platform data variable loses_context is used to determine if the timer may lose its logic state during power transitions and so needs to be restored. This information is also provided in the HWMOD device attributes for OMAP2+ devices via the OMAP_TIMER_ALWON flag. When this flag is set the timer will not lose context. So use the HWMOD device attributes to determine this. For OMAP1 devices, loses_context is never set and so set the OMAP_TIMER_ALWON flag for OMAP1 timers to ensure that code is equivalent. Signed-off-by: Jon Hunter <jon-hunter@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/dmtimer.c8
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h3
2 files changed, 4 insertions, 7 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 30742d8e6819..7aa12785e238 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -341,7 +341,7 @@ int omap_dm_timer_start(struct omap_dm_timer *timer)
omap_dm_timer_enable(timer);
- if (timer->loses_context) {
+ if (!(timer->capability & OMAP_TIMER_ALWON)) {
u32 ctx_loss_cnt_after =
timer->get_context_loss_count(&timer->pdev->dev);
if (ctx_loss_cnt_after != timer->ctx_loss_count)
@@ -374,7 +374,8 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer)
__omap_dm_timer_stop(timer, timer->posted, rate);
- if (timer->loses_context && timer->get_context_loss_count)
+ if (!(timer->capability & OMAP_TIMER_ALWON) &&
+ timer->get_context_loss_count)
timer->ctx_loss_count =
timer->get_context_loss_count(&timer->pdev->dev);
@@ -447,7 +448,7 @@ int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
omap_dm_timer_enable(timer);
- if (timer->loses_context) {
+ if (!(timer->capability & OMAP_TIMER_ALWON)) {
u32 ctx_loss_cnt_after =
timer->get_context_loss_count(&timer->pdev->dev);
if (ctx_loss_cnt_after != timer->ctx_loss_count)
@@ -692,7 +693,6 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
timer->irq = irq->start;
timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
timer->pdev = pdev;
- timer->loses_context = pdata->loses_context;
timer->get_context_loss_count = pdata->get_context_loss_count;
timer->capability = pdata->timer_capability;
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 362cf97d721c..0a7ed31954ea 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -91,8 +91,6 @@ struct timer_regs {
struct dmtimer_platform_data {
int (*set_timer_src)(struct platform_device *pdev, int source);
u32 needs_manual_reset:1;
- bool loses_context;
-
int (*get_context_loss_count)(struct device *dev);
u32 timer_capability;
};
@@ -264,7 +262,6 @@ struct omap_dm_timer {
unsigned reserved:1;
unsigned posted:1;
struct timer_regs context;
- bool loses_context;
int ctx_loss_count;
int revision;
u32 capability;