aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-omap/clock.c27
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index f244b172f9e1..6cc13e7fd897 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -313,6 +313,33 @@ void clk_enable_init_clocks(void)
313 } 313 }
314} 314}
315 315
316/**
317 * omap_clk_get_by_name - locate OMAP struct clk by its name
318 * @name: name of the struct clk to locate
319 *
320 * Locate an OMAP struct clk by its name. Assumes that struct clk
321 * names are unique. Returns NULL if not found or a pointer to the
322 * struct clk if found.
323 */
324struct clk *omap_clk_get_by_name(const char *name)
325{
326 struct clk *c;
327 struct clk *ret = NULL;
328
329 mutex_lock(&clocks_mutex);
330
331 list_for_each_entry(c, &clocks, node) {
332 if (!strcmp(c->name, name)) {
333 ret = c;
334 break;
335 }
336 }
337
338 mutex_unlock(&clocks_mutex);
339
340 return ret;
341}
342
316/* 343/*
317 * Low level helpers 344 * Low level helpers
318 */ 345 */
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index de078afc65df..9b4701f14984 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -182,6 +182,7 @@ unsigned long omap_fixed_divisor_recalc(struct clk *clk);
182extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); 182extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
183extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); 183extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
184#endif 184#endif
185extern struct clk *omap_clk_get_by_name(const char *name);
185 186
186extern const struct clkops clkops_null; 187extern const struct clkops clkops_null;
187 188