diff options
-rw-r--r-- | arch/arm/plat-omap/clock.c | 32 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clock.h | 6 |
2 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index fc62fb5fc20b..0ae0eae01fd1 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -335,6 +335,38 @@ struct clk *omap_clk_get_by_name(const char *name) | |||
335 | return ret; | 335 | return ret; |
336 | } | 336 | } |
337 | 337 | ||
338 | int omap_clk_enable_autoidle_all(void) | ||
339 | { | ||
340 | struct clk *c; | ||
341 | unsigned long flags; | ||
342 | |||
343 | spin_lock_irqsave(&clockfw_lock, flags); | ||
344 | |||
345 | list_for_each_entry(c, &clocks, node) | ||
346 | if (c->ops->allow_idle) | ||
347 | c->ops->allow_idle(c); | ||
348 | |||
349 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
350 | |||
351 | return 0; | ||
352 | } | ||
353 | |||
354 | int omap_clk_disable_autoidle_all(void) | ||
355 | { | ||
356 | struct clk *c; | ||
357 | unsigned long flags; | ||
358 | |||
359 | spin_lock_irqsave(&clockfw_lock, flags); | ||
360 | |||
361 | list_for_each_entry(c, &clocks, node) | ||
362 | if (c->ops->deny_idle) | ||
363 | c->ops->deny_idle(c); | ||
364 | |||
365 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
366 | |||
367 | return 0; | ||
368 | } | ||
369 | |||
338 | /* | 370 | /* |
339 | * Low level helpers | 371 | * Low level helpers |
340 | */ | 372 | */ |
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h index d43e6234dbbb..be69f5cac32d 100644 --- a/arch/arm/plat-omap/include/plat/clock.h +++ b/arch/arm/plat-omap/include/plat/clock.h | |||
@@ -25,6 +25,8 @@ struct clockdomain; | |||
25 | * @disable: fn ptr that enables the current clock in hardware | 25 | * @disable: fn ptr that enables the current clock in hardware |
26 | * @find_idlest: function returning the IDLEST register for the clock's IP blk | 26 | * @find_idlest: function returning the IDLEST register for the clock's IP blk |
27 | * @find_companion: function returning the "companion" clk reg for the clock | 27 | * @find_companion: function returning the "companion" clk reg for the clock |
28 | * @allow_idle: fn ptr that enables autoidle for the current clock in hardware | ||
29 | * @deny_idle: fn ptr that disables autoidle for the current clock in hardware | ||
28 | * | 30 | * |
29 | * A "companion" clk is an accompanying clock to the one being queried | 31 | * A "companion" clk is an accompanying clock to the one being queried |
30 | * that must be enabled for the IP module connected to the clock to | 32 | * that must be enabled for the IP module connected to the clock to |
@@ -42,6 +44,8 @@ struct clkops { | |||
42 | u8 *, u8 *); | 44 | u8 *, u8 *); |
43 | void (*find_companion)(struct clk *, void __iomem **, | 45 | void (*find_companion)(struct clk *, void __iomem **, |
44 | u8 *); | 46 | u8 *); |
47 | void (*allow_idle)(struct clk *); | ||
48 | void (*deny_idle)(struct clk *); | ||
45 | }; | 49 | }; |
46 | 50 | ||
47 | #ifdef CONFIG_ARCH_OMAP2PLUS | 51 | #ifdef CONFIG_ARCH_OMAP2PLUS |
@@ -293,6 +297,8 @@ extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | |||
293 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); | 297 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); |
294 | #endif | 298 | #endif |
295 | extern struct clk *omap_clk_get_by_name(const char *name); | 299 | extern struct clk *omap_clk_get_by_name(const char *name); |
300 | extern int omap_clk_enable_autoidle_all(void); | ||
301 | extern int omap_clk_disable_autoidle_all(void); | ||
296 | 302 | ||
297 | extern const struct clkops clkops_null; | 303 | extern const struct clkops clkops_null; |
298 | 304 | ||