aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2012-06-01 04:32:49 -0400
committerPaul Walmsley <paul@pwsan.com>2012-11-12 21:10:19 -0500
commit8577413c0a26e9bc0b412289640243f3b20f4517 (patch)
tree03b2024a1c5474cd4e23ed07232460149d3dd13f
parent23fb8ba3a8f55f28a7a89b64b3711fcf72239d7f (diff)
ARM: OMAP: clock: Define a function to enable clocks at init
Platform code can use omap2_clk_enable_init_clocks() to enable a list of clocks that are needed to be enabled at init. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Mike Turquette <mturquette@ti.com> [paul@pwsan.com: added kerneldoc to non-trivial new function] Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r--arch/arm/mach-omap2/clock.c21
-rw-r--r--arch/arm/mach-omap2/clock.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index c64203e55d19..744e6eb17b26 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -580,6 +580,27 @@ int omap2_clk_disable_autoidle_all(void)
580 return 0; 580 return 0;
581} 581}
582 582
583/**
584 * omap2_clk_enable_init_clocks - prepare & enable a list of clocks
585 * @clk_names: ptr to an array of strings of clock names to enable
586 * @num_clocks: number of clock names in @clk_names
587 *
588 * Prepare and enable a list of clocks, named by @clk_names. No
589 * return value. XXX Deprecated; only needed until these clocks are
590 * properly claimed and enabled by the drivers or core code that uses
591 * them. XXX What code disables & calls clk_put on these clocks?
592 */
593void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
594{
595 struct clk *init_clk;
596 int i;
597
598 for (i = 0; i < num_clocks; i++) {
599 init_clk = clk_get(NULL, clk_names[i]);
600 clk_prepare_enable(init_clk);
601 }
602}
603
583const struct clk_hw_omap_ops clkhwops_wait = { 604const struct clk_hw_omap_ops clkhwops_wait = {
584 .find_idlest = omap2_clk_dflt_find_idlest, 605 .find_idlest = omap2_clk_dflt_find_idlest,
585 .find_companion = omap2_clk_dflt_find_companion, 606 .find_companion = omap2_clk_dflt_find_companion,
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 20a3be77cb8b..e669fc839859 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -538,6 +538,7 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
538void omap2_init_clk_hw_omap_clocks(struct clk *clk); 538void omap2_init_clk_hw_omap_clocks(struct clk *clk);
539int omap2_clk_enable_autoidle_all(void); 539int omap2_clk_enable_autoidle_all(void);
540int omap2_clk_disable_autoidle_all(void); 540int omap2_clk_disable_autoidle_all(void);
541void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
541#else 542#else
542int omap2_dflt_clk_enable(struct clk *clk); 543int omap2_dflt_clk_enable(struct clk *clk);
543void omap2_dflt_clk_disable(struct clk *clk); 544void omap2_dflt_clk_disable(struct clk *clk);