13 #include <linux/kernel.h>
15 #include <linux/list.h>
16 #include <linux/errno.h>
17 #include <linux/export.h>
19 #include <linux/string.h>
25 #include <plat/clock.h>
42 if (clk ==
NULL || IS_ERR(clk))
50 spin_unlock_irqrestore(&clockfw_lock, flags);
60 if (clk ==
NULL || IS_ERR(clk))
68 pr_err(
"Trying disable clock %s with 0 usecount\n",
77 spin_unlock_irqrestore(&clockfw_lock, flags);
86 if (clk ==
NULL || IS_ERR(clk))
91 spin_unlock_irqrestore(&clockfw_lock, flags);
106 if (clk ==
NULL || IS_ERR(clk))
114 spin_unlock_irqrestore(&clockfw_lock, flags);
125 if (clk ==
NULL || IS_ERR(clk))
135 spin_unlock_irqrestore(&clockfw_lock, flags);
146 if (clk ==
NULL || IS_ERR(clk) || parent ==
NULL || IS_ERR(parent))
159 spin_unlock_irqrestore(&clockfw_lock, flags);
181 static int __init omap_clk_setup(
char *
str)
193 __setup(
"mpurate=", omap_clk_setup);
214 list_del_init(&child->
sibling);
269 if (clk ==
NULL || IS_ERR(clk))
275 if (clk->
node.next || clk->
node.prev)
282 list_add(&clk->
sibling, &root_clks);
284 list_add(&clk->
node, &clocks);
295 if (clk ==
NULL || IS_ERR(clk))
323 if (c->
ops->allow_idle)
324 c->
ops->allow_idle(c);
326 spin_unlock_irqrestore(&clockfw_lock, flags);
339 if (c->
ops->deny_idle)
340 c->
ops->deny_idle(c);
342 spin_unlock_irqrestore(&clockfw_lock, flags);
350 static int clkll_enable_null(
struct clk *
clk)
355 static void clkll_disable_null(
struct clk *
clk)
360 .enable = clkll_enable_null,
361 .disable = clkll_disable_null,
378 #ifdef CONFIG_OMAP_RESET_CLOCKS
382 static int __init clk_disable_unused(
void)
390 pr_info(
"clock: disabling unused clocks to save power\n");
394 if (ck->
ops == &clkops_null)
402 spin_unlock_irqrestore(&clockfw_lock, flags);
412 if (!custom_clocks) {
413 pr_err(
"No custom clock functions registered\n");
417 arch_clock = custom_clocks;
422 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
430 static struct dentry *clk_debugfs_root;
439 "clock-name",
"parent-name",
"rate",
"use-count");
457 .
open = clk_dbg_open,
463 static int clk_debugfs_register_one(
struct clk *
c)
496 static int clk_debugfs_register(
struct clk *c)
501 if (pa && !pa->dent) {
502 err = clk_debugfs_register(pa);
508 err = clk_debugfs_register_one(c);
515 static int __init clk_debugfs_init(
void)
524 clk_debugfs_root =
d;
527 err = clk_debugfs_register(c);
533 d,
NULL, &debug_clock_fops);