diff options
author | Jon Hunter <jon-hunter@ti.com> | 2012-06-05 13:34:56 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-06-14 05:39:47 -0400 |
commit | 0b30ec1cb7f1b0134b16670f886baaf3521b083c (patch) | |
tree | 3f7eb333103e29373e6d3478acd69b23ad1d2be6 /arch/arm/plat-omap/dmtimer.c | |
parent | 1c2d076b589225e51e022d85bb9f25dca26530f3 (diff) |
ARM: OMAP: Remove timer function pointer for context loss counter
For OMAP2+ devices, a function pointer that returns the number of times a timer
power domain has lost context is passed to the dmtimer driver. This function
pointer is only populated for OMAP2+ devices and it is pointing to a platform
function. Given that this is a platform function, we can simplify the code by
removing the function pointer and referencing the function directly. We can use
the OMAP_TIMER_ALWON flag to determine if we need to call this function for
OMAP1 and OMAP2+ devices.
The benefit of this change is the we can remove the function pointer from the
platform data and simplifies the dmtimer migration to device-tree.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/dmtimer.c')
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 7aa12785e238..7875eefd0474 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/pm_runtime.h> | 42 | #include <linux/pm_runtime.h> |
43 | 43 | ||
44 | #include <plat/dmtimer.h> | 44 | #include <plat/dmtimer.h> |
45 | #include <plat/omap-pm.h> | ||
45 | 46 | ||
46 | #include <mach/hardware.h> | 47 | #include <mach/hardware.h> |
47 | 48 | ||
@@ -342,9 +343,8 @@ int omap_dm_timer_start(struct omap_dm_timer *timer) | |||
342 | omap_dm_timer_enable(timer); | 343 | omap_dm_timer_enable(timer); |
343 | 344 | ||
344 | if (!(timer->capability & OMAP_TIMER_ALWON)) { | 345 | if (!(timer->capability & OMAP_TIMER_ALWON)) { |
345 | u32 ctx_loss_cnt_after = | 346 | if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) != |
346 | timer->get_context_loss_count(&timer->pdev->dev); | 347 | timer->ctx_loss_count) |
347 | if (ctx_loss_cnt_after != timer->ctx_loss_count) | ||
348 | omap_timer_restore_context(timer); | 348 | omap_timer_restore_context(timer); |
349 | } | 349 | } |
350 | 350 | ||
@@ -374,10 +374,9 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer) | |||
374 | 374 | ||
375 | __omap_dm_timer_stop(timer, timer->posted, rate); | 375 | __omap_dm_timer_stop(timer, timer->posted, rate); |
376 | 376 | ||
377 | if (!(timer->capability & OMAP_TIMER_ALWON) && | 377 | if (!(timer->capability & OMAP_TIMER_ALWON)) |
378 | timer->get_context_loss_count) | ||
379 | timer->ctx_loss_count = | 378 | timer->ctx_loss_count = |
380 | timer->get_context_loss_count(&timer->pdev->dev); | 379 | omap_pm_get_dev_context_loss_count(&timer->pdev->dev); |
381 | 380 | ||
382 | /* | 381 | /* |
383 | * Since the register values are computed and written within | 382 | * Since the register values are computed and written within |
@@ -449,9 +448,8 @@ int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, | |||
449 | omap_dm_timer_enable(timer); | 448 | omap_dm_timer_enable(timer); |
450 | 449 | ||
451 | if (!(timer->capability & OMAP_TIMER_ALWON)) { | 450 | if (!(timer->capability & OMAP_TIMER_ALWON)) { |
452 | u32 ctx_loss_cnt_after = | 451 | if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) != |
453 | timer->get_context_loss_count(&timer->pdev->dev); | 452 | timer->ctx_loss_count) |
454 | if (ctx_loss_cnt_after != timer->ctx_loss_count) | ||
455 | omap_timer_restore_context(timer); | 453 | omap_timer_restore_context(timer); |
456 | } | 454 | } |
457 | 455 | ||
@@ -693,7 +691,6 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev) | |||
693 | timer->irq = irq->start; | 691 | timer->irq = irq->start; |
694 | timer->reserved = omap_dm_timer_reserved_systimer(timer->id); | 692 | timer->reserved = omap_dm_timer_reserved_systimer(timer->id); |
695 | timer->pdev = pdev; | 693 | timer->pdev = pdev; |
696 | timer->get_context_loss_count = pdata->get_context_loss_count; | ||
697 | timer->capability = pdata->timer_capability; | 694 | timer->capability = pdata->timer_capability; |
698 | 695 | ||
699 | /* Skip pm_runtime_enable for OMAP1 */ | 696 | /* Skip pm_runtime_enable for OMAP1 */ |