diff options
author | Paul Walmsley <paul@pwsan.com> | 2012-09-03 13:50:43 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-09-03 13:50:43 -0400 |
commit | bfb7dd25fcde96d08591258bc7e97500337a57ee (patch) | |
tree | 6dc2a0d83c249075703e78d7f0795cd5b368b7d7 /arch/arm/mach-omap2 | |
parent | 4cbe5a555fa58a79b6ecbb6c531b8bab0650778d (diff) |
ARM: OMAP3xxx: clockdomain: fix software supervised wakeup/sleep
Commit 4da71ae6 ("OMAP: clockdomain: Arch specific funcs for
clkdm_clk_enable/disable") called the OMAP2xxx-specific functions for
clockdomain wakeup and sleep. This would probably have broken
software-supervised clockdomain wakeup and sleep on OMAP3.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Jon Hunter <jon-hunter@ti.com>
Acked-by: Rajendra Nayak <rnayak@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c index a0d68dbecfa3..f99e65cfb862 100644 --- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | |||
@@ -241,6 +241,52 @@ static void omap3_clkdm_deny_idle(struct clockdomain *clkdm) | |||
241 | _clkdm_del_autodeps(clkdm); | 241 | _clkdm_del_autodeps(clkdm); |
242 | } | 242 | } |
243 | 243 | ||
244 | static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm) | ||
245 | { | ||
246 | bool hwsup = false; | ||
247 | |||
248 | if (!clkdm->clktrctrl_mask) | ||
249 | return 0; | ||
250 | |||
251 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
252 | clkdm->clktrctrl_mask); | ||
253 | |||
254 | if (hwsup) { | ||
255 | /* Disable HW transitions when we are changing deps */ | ||
256 | _disable_hwsup(clkdm); | ||
257 | _clkdm_add_autodeps(clkdm); | ||
258 | _enable_hwsup(clkdm); | ||
259 | } else { | ||
260 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | ||
261 | omap3_clkdm_wakeup(clkdm); | ||
262 | } | ||
263 | |||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm) | ||
268 | { | ||
269 | bool hwsup = false; | ||
270 | |||
271 | if (!clkdm->clktrctrl_mask) | ||
272 | return 0; | ||
273 | |||
274 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
275 | clkdm->clktrctrl_mask); | ||
276 | |||
277 | if (hwsup) { | ||
278 | /* Disable HW transitions when we are changing deps */ | ||
279 | _disable_hwsup(clkdm); | ||
280 | _clkdm_del_autodeps(clkdm); | ||
281 | _enable_hwsup(clkdm); | ||
282 | } else { | ||
283 | if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP) | ||
284 | omap3_clkdm_sleep(clkdm); | ||
285 | } | ||
286 | |||
287 | return 0; | ||
288 | } | ||
289 | |||
244 | struct clkdm_ops omap2_clkdm_operations = { | 290 | struct clkdm_ops omap2_clkdm_operations = { |
245 | .clkdm_add_wkdep = omap2_clkdm_add_wkdep, | 291 | .clkdm_add_wkdep = omap2_clkdm_add_wkdep, |
246 | .clkdm_del_wkdep = omap2_clkdm_del_wkdep, | 292 | .clkdm_del_wkdep = omap2_clkdm_del_wkdep, |
@@ -267,6 +313,6 @@ struct clkdm_ops omap3_clkdm_operations = { | |||
267 | .clkdm_wakeup = omap3_clkdm_wakeup, | 313 | .clkdm_wakeup = omap3_clkdm_wakeup, |
268 | .clkdm_allow_idle = omap3_clkdm_allow_idle, | 314 | .clkdm_allow_idle = omap3_clkdm_allow_idle, |
269 | .clkdm_deny_idle = omap3_clkdm_deny_idle, | 315 | .clkdm_deny_idle = omap3_clkdm_deny_idle, |
270 | .clkdm_clk_enable = omap2_clkdm_clk_enable, | 316 | .clkdm_clk_enable = omap3xxx_clkdm_clk_enable, |
271 | .clkdm_clk_disable = omap2_clkdm_clk_disable, | 317 | .clkdm_clk_disable = omap3xxx_clkdm_clk_disable, |
272 | }; | 318 | }; |