diff options
author | Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com> | 2012-06-07 17:19:08 -0500 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-09-07 13:05:30 +0800 |
commit | 53486726c24dd379d8dbc5a9bb822290293c1c5b (patch) | |
tree | 15caf221404900866e1d09395bbb47a3d7ea5843 | |
parent | f0ff09477ee37ee5cc6ed8064a7f6a2fbd4710bf (diff) |
remoteproc: omap: disable/enable timers in suspend/resume
The timers associated with a remoteproc need to be running only
when the processor is active and executing, and need to be stopped
otherwise to allow the timer driver to reach low-power states. The
timers therefore are stopped and restarted appropriately in the
remoteproc's suspend and resume callbacks.
Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
-rw-r--r-- | drivers/remoteproc/omap_remoteproc.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 4e84428328ea..e4db09f0cec7 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -333,9 +333,10 @@ static int _suspend(struct rproc *rproc, bool auto_suspend) struct platform_device *pdev = to_platform_device(dev); struct omap_rproc_pdata *pdata = dev->platform_data; struct omap_rproc *oproc = rproc->priv; + struct omap_rproc_timers_info *timers = pdata->timers; unsigned long to = msecs_to_jiffies(oproc->suspend_timeout); unsigned long ta = jiffies + to; - int ret; + int ret, i; init_completion(&oproc->pm_comp); oproc->suspend_acked = false; @@ -366,6 +367,9 @@ static int _suspend(struct rproc *rproc, bool auto_suspend) if (ret) return ret; + for (i = 0; i < pdata->timers_cnt; i++) + omap_dm_timer_stop(timers[i].odt); + oproc->suspended = true; return 0; @@ -393,6 +397,8 @@ static int omap_rproc_resume(struct rproc *rproc) struct platform_device *pdev = to_platform_device(dev); struct omap_rproc_pdata *pdata = dev->platform_data; struct omap_rproc *oproc = rproc->priv; + struct omap_rproc_timers_info *timers = pdata->timers; + int ret, i; oproc->suspended = false; /* boot address could be lost after suspend, so restore it */ @@ -410,7 +416,15 @@ static int omap_rproc_resume(struct rproc *rproc) oproc->need_kick = false; } - return pdata->device_enable(pdev); + for (i = 0; i < pdata->timers_cnt; i++) + omap_dm_timer_start(timers[i].odt); + + ret = pdata->device_enable(pdev); + if (ret) + for (i = 0; i < pdata->timers_cnt; i++) + omap_dm_timer_stop(timers[i].odt); + + return ret; } static struct rproc_ops omap_rproc_ops = { |