summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-fixed.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-07 10:34:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-15 09:53:30 +0100
commit87eebfe9662506ca1d699150a27f6d524ac79a51 (patch)
tree5fb0451d104d144c359afef23f576dc22fe7a6c9 /drivers/clk/clk-fixed.c
parentd34aca4c09615870b694820dc21049bd1e77030e (diff)
downloadbarebox-87eebfe9662506ca1d699150a27f6d524ac79a51.tar.gz
barebox-87eebfe9662506ca1d699150a27f6d524ac79a51.tar.xz
clk: Add is_enabled callback
This allows us to better detect whether a clk is enabled or not. - If we can ask a clk, ask it. If it's enabled, go on and ask parents - If we can't ask it, but it can be enabled, depend on the enable_count. if it's positive, go on and ask parents - If we can't ask it and it cannot be enabled, assume it is enabled and ask parents. This makes the CLK_ALWAYS_ENABLED unnecessary, since the fixed clk now always returns 1 in its is_enabled callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/clk/clk-fixed.c')
-rw-r--r--drivers/clk/clk-fixed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk-fixed.c b/drivers/clk/clk-fixed.c
index 5e81e72946..e5d36b4ffa 100644
--- a/drivers/clk/clk-fixed.c
+++ b/drivers/clk/clk-fixed.c
@@ -34,6 +34,7 @@ static unsigned long clk_fixed_recalc_rate(struct clk *clk,
struct clk_ops clk_fixed_ops = {
.recalc_rate = clk_fixed_recalc_rate,
+ .is_enabled = clk_is_enabled_always,
};
struct clk *clk_fixed(const char *name, int rate)
@@ -44,7 +45,6 @@ struct clk *clk_fixed(const char *name, int rate)
fix->rate = rate;
fix->clk.ops = &clk_fixed_ops;
fix->clk.name = name;
- fix->clk.flags = CLK_ALWAYS_ENABLED;
ret = clk_register(&fix->clk);
if (ret) {