aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTarun Kanti DebBarma <tarun.kanti@ti.com>2011-07-09 16:02:50 -0500
committerNishanth Menon <nm@ti.com>2011-07-14 11:53:02 -0700
commit0e765e8a03dfdecf4d6033cf01eae18b2118cc20 (patch)
tree8378140aa7ee7d8754fe2407a485cd63df0b11ab /arch
parentb83b18e2b85abcba85c4c139aa123b7c5643b21a (diff)
downloadkernel_samsung_tuna-0e765e8a03dfdecf4d6033cf01eae18b2118cc20.zip
kernel_samsung_tuna-0e765e8a03dfdecf4d6033cf01eae18b2118cc20.tar.gz
kernel_samsung_tuna-0e765e8a03dfdecf4d6033cf01eae18b2118cc20.tar.bz2
OMAP: dmtimer: pm_runtime support
Add pm_runtime feature to dmtimer whereby _get_sync() is called within omap_dm_timer_enable(), _put_sync() is called in omap_dm_timer_disable(). As part of this, I am getting rid of the 'enabled' flag since this is no longer needed. This has been replaced by pm_runtime_suspended() check. Change-Id: I11a9b9deb1fab12542ade20575758a53b669ada9 [girishsg@ti.com: Rebased] Signed-off-by: Girish S G <girishsg@ti.com> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com> [p-basak2@ti.com: added pm_runtime logic in probe()] Signed-off-by: Partha Basak <p-basak2@ti.com> Reviewed-by: Varadarajan, Charulatha <charu@ti.com> Acked-by: Cousson, Benoit <b-cousson@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/dmtimer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 0ab6bc7..d750b32 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -39,6 +39,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>
+#include <linux/pm_runtime.h>
#include <linux/err.h>
#include <linux/platform_device.h>
@@ -335,7 +336,7 @@ void omap_dm_timer_enable(struct omap_dm_timer *timer)
if (timer->enabled)
return;
- clk_enable(timer->fclk);
+ pm_runtime_get_sync(&timer->pdev->dev);
timer->enabled = 1;
}
@@ -346,7 +347,7 @@ void omap_dm_timer_disable(struct omap_dm_timer *timer)
if (!timer->enabled)
return;
- clk_disable(timer->fclk);
+ pm_runtime_put_sync(&timer->pdev->dev);
timer->enabled = 0;
}
@@ -683,6 +684,10 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
timer->irq = irq->start;
timer->pdev = pdev;
+ /* Skip pm_runtime_enable during early boot and for OMAP1 */
+ if (!pdata->is_early_init && !pdata->needs_manual_reset)
+ pm_runtime_enable(&pdev->dev);
+
/* add the timer element to the list */
spin_lock_irqsave(&dm_timer_lock, flags);
list_add_tail(&timer->node, &omap_timer_list);