diff options
-rw-r--r-- | arch/arm/mach-omap2/timer.c | 3 | ||||
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 17 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dmtimer.h | 3 |
3 files changed, 7 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 9b6880a33793..0e17a0d9690b 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -494,9 +494,6 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused) | |||
494 | if (timer_dev_attr) | 494 | if (timer_dev_attr) |
495 | pdata->timer_capability = timer_dev_attr->timer_capability; | 495 | pdata->timer_capability = timer_dev_attr->timer_capability; |
496 | 496 | ||
497 | #ifdef CONFIG_PM | ||
498 | pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; | ||
499 | #endif | ||
500 | pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata), | 497 | pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata), |
501 | NULL, 0, 0); | 498 | NULL, 0, 0); |
502 | 499 | ||
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 */ |
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h index 0a7ed31954ea..e11c9ea7ec53 100644 --- a/arch/arm/plat-omap/include/plat/dmtimer.h +++ b/arch/arm/plat-omap/include/plat/dmtimer.h | |||
@@ -91,7 +91,6 @@ struct timer_regs { | |||
91 | struct dmtimer_platform_data { | 91 | struct dmtimer_platform_data { |
92 | int (*set_timer_src)(struct platform_device *pdev, int source); | 92 | int (*set_timer_src)(struct platform_device *pdev, int source); |
93 | u32 needs_manual_reset:1; | 93 | u32 needs_manual_reset:1; |
94 | int (*get_context_loss_count)(struct device *dev); | ||
95 | u32 timer_capability; | 94 | u32 timer_capability; |
96 | }; | 95 | }; |
97 | 96 | ||
@@ -267,8 +266,6 @@ struct omap_dm_timer { | |||
267 | u32 capability; | 266 | u32 capability; |
268 | struct platform_device *pdev; | 267 | struct platform_device *pdev; |
269 | struct list_head node; | 268 | struct list_head node; |
270 | |||
271 | int (*get_context_loss_count)(struct device *dev); | ||
272 | }; | 269 | }; |
273 | 270 | ||
274 | int omap_dm_timer_prepare(struct omap_dm_timer *timer); | 271 | int omap_dm_timer_prepare(struct omap_dm_timer *timer); |