]> Git Repo - linux.git/commitdiff
ARM: OMAP2+: PMU: Add runtime PM support
authorJon Hunter <[email protected]>
Sun, 23 Sep 2012 23:28:30 +0000 (17:28 -0600)
committerPaul Walmsley <[email protected]>
Sun, 23 Sep 2012 23:28:30 +0000 (17:28 -0600)
The original implementation of this patch was done by Ming Lei for PMU on OMAP4
[1]. Since then the PM runtime calls have been moved into the ARM PMU code and
this greatly simplifies the changes.

The another differnce since the original version, is that it is no longer
necessary to call pm_runtime_get/put during the PMU initialisation was we are no
longer accessing the hardware at this stage.

By adding runtime PM support, we can ensure that the appropriate power and clock
domains are kept on while PMU is being used.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-November/074153.html

Cc: Ming Lei <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Benoit Cousson <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Kevin Hilman <[email protected]>
Signed-off-by: Jon Hunter <[email protected]>
Signed-off-by: Paul Walmsley <[email protected]>
arch/arm/mach-omap2/pmu.c

index af35c77c4ab4600eeefca97d647eecdd479dd47c..05600374c240decc4d60f7736f298ae04ab10674 100644 (file)
@@ -11,6 +11,7 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
+#include <linux/pm_runtime.h>
 
 #include <asm/pmu.h>
 
@@ -53,7 +54,12 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
        WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n",
             dev_name);
 
-       return IS_ERR(omap_pmu_dev) ? PTR_ERR(omap_pmu_dev) : 0;
+       if (IS_ERR(omap_pmu_dev))
+               return PTR_ERR(omap_pmu_dev);
+
+       pm_runtime_enable(&omap_pmu_dev->dev);
+
+       return 0;
 }
 
 static int __init omap_init_pmu(void)
This page took 0.057787 seconds and 4 git commands to generate.