diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2011-01-05 11:33:17 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-12-08 14:28:59 -0500 |
commit | 3c50729b3fa1cd8ca1f347e6caf1081204cf1a7c (patch) | |
tree | da2dc3dbdd0b07e1f987dbe31c1e1ca68c2a413e /arch/arm/mach-omap2/pm44xx.c | |
parent | 361b02f3538bc5603a426ed3bb04129a8d7b9a67 (diff) |
ARM: OMAP4: PM: Initialise all the clockdomains to supported states
Initialise hardware supervised mode for all clockdomains if it's
supported. Initiate sleep transition for other clockdomains,
if they are not being used.
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm44xx.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 35d392abcaa4..c34139dc8d8c 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | 18 | ||
19 | #include "common.h" | 19 | #include "common.h" |
20 | #include "clockdomain.h" | ||
20 | #include "powerdomain.h" | 21 | #include "powerdomain.h" |
21 | 22 | ||
22 | struct power_state { | 23 | struct power_state { |
@@ -73,6 +74,22 @@ static const struct platform_suspend_ops omap_pm_ops = { | |||
73 | }; | 74 | }; |
74 | #endif /* CONFIG_SUSPEND */ | 75 | #endif /* CONFIG_SUSPEND */ |
75 | 76 | ||
77 | /* | ||
78 | * Enable hardware supervised mode for all clockdomains if it's | ||
79 | * supported. Initiate sleep transition for other clockdomains, if | ||
80 | * they are not used | ||
81 | */ | ||
82 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | ||
83 | { | ||
84 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) | ||
85 | clkdm_allow_idle(clkdm); | ||
86 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && | ||
87 | atomic_read(&clkdm->usecount) == 0) | ||
88 | clkdm_sleep(clkdm); | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | |||
76 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | 93 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) |
77 | { | 94 | { |
78 | struct power_state *pwrst; | 95 | struct power_state *pwrst; |
@@ -146,6 +163,8 @@ static int __init omap4_pm_init(void) | |||
146 | goto err2; | 163 | goto err2; |
147 | } | 164 | } |
148 | 165 | ||
166 | (void) clkdm_for_each(clkdms_setup, NULL); | ||
167 | |||
149 | #ifdef CONFIG_SUSPEND | 168 | #ifdef CONFIG_SUSPEND |
150 | suspend_set_ops(&omap_pm_ops); | 169 | suspend_set_ops(&omap_pm_ops); |
151 | #endif /* CONFIG_SUSPEND */ | 170 | #endif /* CONFIG_SUSPEND */ |