diff options
author | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2011-09-20 17:00:24 +0530 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-09-21 17:07:34 -0700 |
commit | b481113a8af65f49afed46d4c9132b7af9426684 (patch) | |
tree | f468369003b3d0e70342aee8d0cce6b1c637e1a7 /arch/arm/mach-omap2/timer.c | |
parent | 0dad9faeaeb0fa3524068a94e1745b91e5597c17 (diff) | |
download | kernel_goldelico_gta04-b481113a8af65f49afed46d4c9132b7af9426684.zip kernel_goldelico_gta04-b481113a8af65f49afed46d4c9132b7af9426684.tar.gz kernel_goldelico_gta04-b481113a8af65f49afed46d4c9132b7af9426684.tar.bz2 |
ARM: OMAP: dmtimer: low-power mode support
Clock is enabled only when timer is started and disabled when the the timer
is stopped. Therefore before accessing registers in functions clock is enabled
and then disabled back at the end of access. Context save is done dynamically
whenever the registers are modified. Context restore is called when context is
lost.
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[tony@atomide.com: updated to use revision instead of tidr]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/timer.c')
-rw-r--r-- | arch/arm/mach-omap2/timer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index f1e3ec1..1140e98 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -44,6 +44,9 @@ #include <plat/common.h> #include <plat/omap_hwmod.h> #include <plat/omap_device.h> +#include <plat/omap-pm.h> + +#include "powerdomain.h" /* Parent clocks, eventually these will come from the clock framework */ @@ -433,6 +436,7 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused) struct dmtimer_platform_data *pdata; struct omap_device *od; struct omap_timer_capability_dev_attr *timer_dev_attr; + struct powerdomain *pwrdm; pr_debug("%s: %s\n", __func__, oh->name); @@ -467,6 +471,11 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused) if ((sys_timer_reserved >> (id - 1)) & 0x1) pdata->reserved = 1; + pwrdm = omap_hwmod_get_pwrdm(oh); + pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm); +#ifdef CONFIG_PM + pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; +#endif od = omap_device_build(name, id, oh, pdata, sizeof(*pdata), omap2_dmtimer_latency, ARRAY_SIZE(omap2_dmtimer_latency), |