Lines Matching refs:clk

42 #include <dev/clk/clk_backend.h>
93 static struct clk *
97 struct rk_cru_clk *clk;
105 clk = &sc->sc_clks[i];
106 if (clk->id == clock_id)
107 return &clk->base;
117 static struct clk *
121 struct rk_cru_clk *clk;
123 clk = rk_cru_clock_find(sc, name);
124 if (clk == NULL)
127 return &clk->base;
131 rk_cru_clock_put(void *priv, struct clk *clk)
136 rk_cru_clock_get_rate(void *priv, struct clk *clkp)
139 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
140 struct clk *clkp_parent;
142 if (clk->get_rate)
143 return clk->get_rate(sc, clk);
148 clk->base.name);
156 rk_cru_clock_set_rate(void *priv, struct clk *clkp, u_int rate)
159 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
160 struct clk *clkp_parent;
166 clk->base.name);
172 if (clk->set_rate)
173 return clk->set_rate(sc, clk, rate);
179 rk_cru_clock_round_rate(void *priv, struct clk *clkp, u_int rate)
182 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
183 struct clk *clkp_parent;
189 clk->base.name);
195 if (clk->round_rate)
196 return clk->round_rate(sc, clk, rate);
202 rk_cru_clock_enable(void *priv, struct clk *clkp)
205 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
206 struct clk *clkp_parent;
216 if (clk->enable)
217 error = clk->enable(sc, clk, 1);
223 rk_cru_clock_disable(void *priv, struct clk *clkp)
226 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
229 if (clk->enable)
230 error = clk->enable(sc, clk, 0);
236 rk_cru_clock_set_parent(void *priv, struct clk *clkp, struct clk *clkp_parent)
239 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
241 if (clk->set_parent == NULL)
244 return clk->set_parent(sc, clk, clkp_parent->name);
247 static struct clk *
248 rk_cru_clock_get_parent(void *priv, struct clk *clkp)
251 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp;
255 if (clk->get_parent == NULL)
258 parent = clk->get_parent(sc, clk);
340 struct rk_cru_clk *clk;
341 struct clk *clkp_parent;
346 clk = &sc->sc_clks[i];
347 if (clk->type == RK_CRU_UNKNOWN)
350 clkp_parent = clk_get_parent(&clk->base);
352 switch (clk->type) {
363 clk->id,
364 clk->base.name,
368 aprint_debug("%10d Hz\n", clk_get_rate(&clk->base));