Lines Matching refs:clk
5 * clk.c -- general ColdFire CPU kernel clk handling
16 #include <linux/clk.h>
31 void __clk_init_enabled(struct clk *clk)
33 clk->enabled = 1;
34 clk->clk_ops->enable(clk);
37 void __clk_init_disabled(struct clk *clk)
39 clk->enabled = 0;
40 clk->clk_ops->disable(clk);
43 static void __clk_enable0(struct clk *clk)
45 __raw_writeb(clk->slot, MCFPM_PPMCR0);
48 static void __clk_disable0(struct clk *clk)
50 __raw_writeb(clk->slot, MCFPM_PPMSR0);
59 static void __clk_enable1(struct clk *clk)
61 __raw_writeb(clk->slot, MCFPM_PPMCR1);
64 static void __clk_disable1(struct clk *clk)
66 __raw_writeb(clk->slot, MCFPM_PPMSR1);
76 struct clk *clk_get(struct device *dev, const char *id)
79 struct clk *clk;
82 for (i = 0; (clk = mcf_clks[i]) != NULL; ++i)
83 if (!strcmp(clk->name, clk_name))
84 return clk;
90 int clk_enable(struct clk *clk)
94 if ((clk->enabled++ == 0) && clk->clk_ops)
95 clk->clk_ops->enable(clk);
102 void clk_disable(struct clk *clk)
106 if (!clk)
110 if ((--clk->enabled == 0) && clk->clk_ops)
111 clk->clk_ops->disable(clk);
116 void clk_put(struct clk *clk)
118 if (clk->enabled != 0)
119 pr_warn("clk_put %s still enabled\n", clk->name);
123 unsigned long clk_get_rate(struct clk *clk)
125 if (!clk)
128 return clk->rate;
133 long clk_round_rate(struct clk *clk, unsigned long rate)
135 WARN_ON(clk);
140 int clk_set_rate(struct clk *clk, unsigned long rate)
142 WARN_ON(clk);
147 int clk_set_parent(struct clk *clk, struct clk *parent)
149 WARN_ON(clk);
154 struct clk *clk_get_parent(struct clk *clk)
156 WARN_ON(clk);