Lines Matching refs:clk

27 static struct clk cpu_clk_generic[4];
38 struct clk *clk_get_cpu(void) in clk_get_cpu()
43 struct clk *clk_get_fpi(void) in clk_get_fpi()
49 struct clk *clk_get_io(void) in clk_get_io()
55 struct clk *clk_get_ppe(void) in clk_get_ppe()
61 static inline int clk_good(struct clk *clk) in clk_good() argument
63 return clk && !IS_ERR(clk); in clk_good()
66 unsigned long clk_get_rate(struct clk *clk) in clk_get_rate() argument
68 if (unlikely(!clk_good(clk))) in clk_get_rate()
71 if (clk->rate != 0) in clk_get_rate()
72 return clk->rate; in clk_get_rate()
74 if (clk->get_rate != NULL) in clk_get_rate()
75 return clk->get_rate(); in clk_get_rate()
81 int clk_set_rate(struct clk *clk, unsigned long rate) in clk_set_rate() argument
83 if (unlikely(!clk_good(clk))) in clk_set_rate()
85 if (clk->rates && *clk->rates) { in clk_set_rate()
86 unsigned long *r = clk->rates; in clk_set_rate()
92 clk->cl.dev_id, clk->cl.con_id, rate); in clk_set_rate()
96 clk->rate = rate; in clk_set_rate()
101 long clk_round_rate(struct clk *clk, unsigned long rate) in clk_round_rate() argument
103 if (unlikely(!clk_good(clk))) in clk_round_rate()
105 if (clk->rates && *clk->rates) { in clk_round_rate()
106 unsigned long *r = clk->rates; in clk_round_rate()
111 return clk->rate; in clk_round_rate()
118 int clk_enable(struct clk *clk) in clk_enable() argument
120 if (unlikely(!clk_good(clk))) in clk_enable()
123 if (clk->enable) in clk_enable()
124 return clk->enable(clk); in clk_enable()
130 void clk_disable(struct clk *clk) in clk_disable() argument
132 if (unlikely(!clk_good(clk))) in clk_disable()
135 if (clk->disable) in clk_disable()
136 clk->disable(clk); in clk_disable()
140 int clk_activate(struct clk *clk) in clk_activate() argument
142 if (unlikely(!clk_good(clk))) in clk_activate()
145 if (clk->activate) in clk_activate()
146 return clk->activate(clk); in clk_activate()
152 void clk_deactivate(struct clk *clk) in clk_deactivate() argument
154 if (unlikely(!clk_good(clk))) in clk_deactivate()
157 if (clk->deactivate) in clk_deactivate()
158 clk->deactivate(clk); in clk_deactivate()
162 struct clk *clk_get_parent(struct clk *clk) in clk_get_parent() argument
168 int clk_set_parent(struct clk *clk, struct clk *parent) in clk_set_parent() argument
192 struct clk *clk; in plat_time_init() local
196 clk = clk_get_cpu(); in plat_time_init()
197 mips_hpt_frequency = clk_get_rate(clk) / get_counter_resolution(); in plat_time_init()
199 pr_info("CPU Clock: %ldMHz\n", clk_get_rate(clk) / 1000000); in plat_time_init()
200 clk_put(clk); in plat_time_init()